Build Tensorflow from Source

TimoK93TimoK93 New Member Posts: 27 ✭✭

Hi folks,

because i never found a thread containing discussions about compiling tensorflow from source on the Up Board, i open this thread.

Because i got problems by running some keras (backend tensorflow) scripts that work well on other machines, i guess there could be some difficults and so i will report my experiences using tensorflow.

First of all my experience till now:
I installed tensorflow 1.8 with Python 2.7 and 3.5 -> Keras scripts crashed after some seconds because of SIGFAULTS. I downgraded to 1.7 ... 1.6 ... and with 1.5 i got an version that is not crashing.

So now i try to build it manually from source using this guide https://www.tensorflow.org/install/source.

I will report results and would be happy for experiences from others!

Greetings,
Timo Kaiser

Tagged:

Comments

  • eduncan911eduncan911 Administrator, Moderator Posts: 157 admin

    Thanks @TimoK93 and yes let us know. I saw your other thread and found this post from it. I'm assuming this will use the integratesd Intel GPU?

    I will be taking a different approach and using the Intel OpenVINO Toolkit as my SDK for TensorFlow when I get my UP AI Core add-on board to try.

    Eric Duncan - UP Evangelist - My thoughts are of my own free will

    Answered? Please remember to mark the posted answered to highlight it for future visitors!

  • TimoK93TimoK93 New Member Posts: 27 ✭✭
    edited October 2018

    After some trials i installed tensorflow from source!

    I installed latest version (1.10) and used the defaults EXCEPT

    • no Google Support
    • no Hadoop Support
    • no Amazon Support
    • no Kafka Support
    • using the --option=mkl flag

    The first times I used a wrong bazel version (automatically installed the latest version). This caused some compiling errors. The building process lasts about ~3 hours.

    I'm assuming this will use the integratesd Intel GPU?

    I hoped it will, but i think it did not... While starting a tensorflow/keras script, it doesn't show some special "GPU output" you would see with NVIDIA GPUs. The first "test" shows, that the board is quite slowly... Next days i will present a benchmark with GPUs and CPUs and the UP-Board processing the same net.

    I will be taking a different approach and using the Intel OpenVINO Toolkit

    Can you report a little guide?

    Greetings
    Timo

  • eduncan911eduncan911 Administrator, Moderator Posts: 157 admin

    @TimoK93 said:

    I will be taking a different approach and using the Intel OpenVINO Toolkit

    Can you report a little guide?

    https://software.intel.com/en-us/openvino-toolkit/documentation/get-started

    I think those have some good getting started guides.

    Reading the specs of OpenVINO to use Intel's GPU graphics, it looks like you need the UP Squared or the up coming UP Core Plus because of their GPU:

    https://software.intel.com/en-us/openvino-toolkit/choose-download/free-download-linux

    I didn't see the GPUs of the UP Board on that initial list. But it could still work. I don't have a spare UP Board with Linux to try at the moment.

    It should still work without GPU accelleration on the UP Board. It does say that the Intel graphics/GPU are only required if you use GPU accelleration.

    I'm still new to these myself. Waiting on my hardware to play with some of it.

    Eric Duncan - UP Evangelist - My thoughts are of my own free will

    Answered? Please remember to mark the posted answered to highlight it for future visitors!

  • TimoK93TimoK93 New Member Posts: 27 ✭✭

    I tried installing OpenVINO and installation worked well except one Problem:
    The installer installs tensorflow (latest version) by using pip. This was the root problem, so now im trying to rebuilt and install tensorflow from source.

    I will report results!

  • TimoK93TimoK93 New Member Posts: 27 ✭✭

    I installed from source.

    Tensorflow is working but it seems that its working very slow... I do not notice that its working faster with OpenVINO installed. Do you know a possibility to investigate that Tensorflow is using the GPU?

  • eduncan911eduncan911 Administrator, Moderator Posts: 157 admin
    edited October 2018

    I am new to this as well. My UP^2 has Windows at the moment for some other work I am doing. So I haven't had time to investigate.

    Are you sure TensorFlow is using OpenVINO? From the online examples I saw, it would seem you need to modify the C++ complication settings to include the -d GPU parameters (can't recall the exaxt params at the moment, I'm on mobile).

    I ordered the AI Vision kit, but they are on back order due to Intel CPU mass shortage.

    Eric Duncan - UP Evangelist - My thoughts are of my own free will

    Answered? Please remember to mark the posted answered to highlight it for future visitors!

  • eduncan911eduncan911 Administrator, Moderator Posts: 157 admin

    @TimoK93 Did you follow the directions for enabling Graphics support for OpenVINO? It was at the very bottom of the installation guide:

    https://software.intel.com/en-us/articles/OpenVINO-Install-Linux#GPU-steps

    Eric Duncan - UP Evangelist - My thoughts are of my own free will

    Answered? Please remember to mark the posted answered to highlight it for future visitors!

  • TimoK93TimoK93 New Member Posts: 27 ✭✭

    @eduncan911 said:
    @TimoK93 Did you follow the directions for enabling Graphics support for OpenVINO? It was at the very bottom of the installation guide:

    https://software.intel.com/en-us/articles/OpenVINO-Install-Linux#GPU-steps

    Yes i did, except this step:

    7. (Optional) Install header files to allow compiling a new code. You can find the header files at https://github.com/KhronosGroup/OpenCL-Headers.git.

    I just realized, that i misapprehended the OpenVINO Tensorflow support... I thought that OpenVINO Tensorflow works like tensorflow-gpu. Thats my mistake: I did not convert the tensorflow-net to an inference machine. I just red this https://software.intel.com/en-us/articles/OpenVINO-Using-TensorFlow

    I will try to convert the model to the inference machine using the description above.

    One NOTE: I ordered the AI core so i can report my results with UP-Squared and UP-Squared with AI-Core.

  • TimoK93TimoK93 New Member Posts: 27 ✭✭

    Hey,
    here an intermediate result:

    I finished installing OpenVINO and converted a short model to the inference machine. Converting my favorite CNN is aborting with this Error: "Graph contains a cycle. Can not proceed"

    Going forward to solve the issue...

  • eduncan911eduncan911 Administrator, Moderator Posts: 157 admin

    @TimoK93 said:
    Hey,
    here an intermediate result:

    I finished installing OpenVINO and converted a short model to the inference machine. Converting my favorite CNN is aborting with this Error: "Graph contains a cycle. Can not proceed"

    Going forward to solve the issue...

    I was just thinking about this if you had any progress. :smile:

    Sounds like... Some progress. Let us know how it works out!

    Eric Duncan - UP Evangelist - My thoughts are of my own free will

    Answered? Please remember to mark the posted answered to highlight it for future visitors!

  • TimoK93TimoK93 New Member Posts: 27 ✭✭

    Im not sure how to convert the custom layers from the model i use... Did you ever worked with OpenVINO and converted custom layers?

  • eduncan911eduncan911 Administrator, Moderator Posts: 157 admin

    @TimoK93 said:
    Im not sure how to convert the custom layers from the model i use... Did you ever worked with OpenVINO and converted custom layers?

    Not yet. I'm still on some other testing at this moment, waiting on my AI Vision kit to arrive to do that work on.

    Eric Duncan - UP Evangelist - My thoughts are of my own free will

    Answered? Please remember to mark the posted answered to highlight it for future visitors!

Sign In or Register to comment.