Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tensorflow compilation on Odroid XU4

I am trying to compile Tensorflow (tried both: full & lite) on Odroid XU4 (16GB eMMc, Ubuntu 16) but I am getting errors shown in figures: https://www.dropbox.com/sh/j86ysncze1q0eka/AAB8RZtUTkaytqfEGivbev_Ga?dl=0

I am using FlytOS as OS(http://docs.flytbase.com/docs/FlytOS/GettingStarted/OdroidGuide.html). Its customized Ubuntu 16 with OpenCV and ROS setup, makes 11GB after installation. So, I got only 2.4GB free. Therefore, I added 16GB USB as swap memory.

I have installed Bazel without using swap memory. Tried tensorflow full version and lite but failed to compile. However, I downloaded compiled tensorflow lite for Pi and successfully installed on Odroid. Since, Odroid is Octacore, therefore, to make best use of available processing power I need to compile tensorflow on Odroid.

Please let me know if any one has tensorflow compiled on Odroid XU4.

Regards,

like image 547
Mohbat Tharani Avatar asked Oct 09 '17 19:10

Mohbat Tharani


1 Answers

Check this guide out. Build Tensorflow on Odroid

IT gives a detailed step by step guide and also has some troubleshooting procedures.

Summarizing the steps here:

  1. Install prerequisites including g++, gcc-4.8, python-pip, python-dev, numpy and Oracle Java (not OpenJDK)
  2. Use a USB/ Flash drive and add some swap memory
  3. Build Bazel. In the compile.sh shell script, modify the run line to add memory flags

run “${JAVAC}” -J-Xms256m -J-Xmx384m -classpath “${classpath}” -sourcepath “${sourcepath}”

  1. Get Tensorflow v1.4 specifically and run ./configure and select relevant options. Disable XLA as it's causing some problems.
  2. Finally run Bazel command.

bazel build -c opt --copt="-funsafe-math-optimizations" --copt="-ftree-vectorize" --copt="-fomit-frame-pointer" --local_resources 8192,8.0,1.0 --verbose_failures tensorflow/tools/pip_package:build_pip_package

  1. Now install it.

bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg

sudo pip2 install /tmp/tensorflow_pkg/tensorflow-1.4.0-cp27-cp27mu-linux_armv7l.whl --upgrade --ignore-installed

  1. Test the install

    python

    import tensorflow

    print(tensorflow.__version__)

    1.4.0

I was able to compile it successfully by following the steps given there.

like image 54
Anand C U Avatar answered Dec 30 '22 12:12

Anand C U