Tensorflow compilation on Odroid XU4

廉价感情. 提交于 2021-02-07 13:24:33

问题


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,


回答1:


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.



来源:https://stackoverflow.com/questions/46653465/tensorflow-compilation-on-odroid-xu4

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!