Tensorflow on DragonBoard410c

I am starting to work with Debian Linux on DragonBoard410c, and I want to use and run example on Tensorflow, is there anyone who worked with this, and can help me to find examples of models to use them?


1 Like

Thank you, I saw that Ali shows some files like “tensorflow.whl”, how I can get them?


maybe this helps https://github.com/96boards/documentation/blob/master/ConsumerEdition/guides/tensorflow-installation.md

can you provide wheel of tensorflow to us?
Thank you very much

Hi @ric96

Because it seems DragonBoard410c’s storage is not enough, I try to follow the following guild which for RPi.
But I still meet some problem to build it.
Do you ever build tensorflow in Dragonboard410c?
If yes, do you have test wheel of tensoflow can provide for me to test?
Thanks for your kindly reply.

Best regards,

If the internal memory seems less you can try booting from sdcard.

I tried to build Tensorflow on the DragonBoard 410c. To make sure I had ‘lots’ of space I formatted a 64GB SDCard and mounted it in the directory /home/linaro/workspace. I think 64GB should be enough storage space to load the source and compile it. I also made sure I had ‘lots’ of memory, I installed zram, and I also allocated 1.5GB of swapspace on the eMMC. After setup free tells me I have over 4GB of available swap space. Although it won’t be fast I think this should be enough space and memory to build tensorflow.

The first thing you need is the build tool bazel so I needed to build bazel first. The following script should build bazel:

# build bazel from source because there is no arm64 version prebuilt
sudo apt-get install -y build-essential openjdk-8-jdk python3 zip
mkdir bazel-bootstrap
cd bazel-bootstrap
wget https://github.com/bazelbuild/bazel/releases/download/0.8.1/bazel-0.8.1-dist.zip
unzip bazel-0.8.1-dist.zip
cp output/bazel ~/bin
cd ..

Unfortunately this fails on the DragonBoard 410c. Java runs out of heap space. I tried several different methods to increase the java heap space, but it always fails to build bazel. So I built bazel on a larger arm64 machine (with 3GB of RAM, the script works fine) and copied the 91MB bazel executable to the 410c.

Next you need to build tensor flow. The following script should build tensorflow:

# build tensorflow
sudo apt-get install python-numpy python-dev python-pip python-wheel python-all-dev
#sudo apt-get install python3-numpy python3-dev python3-pip python3-wheel
git clone https://github.com/tensorflow/tensorflow
cd tensorflow
git checkout master
echo answer to the first configure option is "/usr/bin/python2.7"
echo Accept all of the defaults for the remaining configuration questions
bazel build --config=opt //tensorflow/tools/pip_package:build_pip_package
bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg
bazel shutdown
sudo pip install /tmp/tensorflow_pkg/tensorflow-1.4.0-py2-none-any.whl
cd ..

This takes a really long time to run, but eventually builds the whl file. I haven’t gone to the next step, actually doing something useful with tensorflow, or even running the examples. a task for another day.

On a side note: The faster machine that had successfully built bazel failed trying to build tensorflow. It appears that the newer compiler has issues (internal compiler error). Here is the tail of the build error message.

ERROR: /home/linaro/workspace/tensorflow/tensorflow/contrib/lite/toco/BUILD:169:1: C++ compilation of rule '//tensorflow/contrib/lite/toco:graph_transformations' failed (Exit 1)
In file included from /usr/include/c++/7/bits/move.h:54:0,
                 from /usr/include/c++/7/bits/stl_pair.h:59,
                 from /usr/include/c++/7/utility:70,
                 from /usr/include/c++/7/algorithm:60,
                 from tensorflow/contrib/lite/toco/graph_transformations/read_fake_quant_min_max.cc:15:
/usr/include/c++/7/type_traits: In instantiation of 'struct std::remove_const<std::default_delete<toco::Operator> >':
/usr/include/c++/7/type_traits:1574:67:   required from 'struct std::remove_cv<std::default_delete<toco::Operator> >'
/usr/include/c++/7/type_traits:380:12:   required from 'struct std::is_pointer<std::default_delete<toco::Operator> >'
/usr/include/c++/7/type_traits:154:31:   required from 'struct std::__not_<std::is_pointer<std::default_delete<toco::Operator> > >'
/usr/include/c++/7/type_traits:143:12:   required from 'struct std::__and_<std::__not_<std::is_pointer<std::default_delete<toco::Operator> > >, std::is_default_constructible<std::default_delete<toco::Operator> > >'
/usr/include/c++/7/bits/unique_ptr.h:135:47:   required from 'class std::__uniq_ptr_impl<toco::Operator, std::default_delete<toco::Operator> >'
/usr/include/c++/7/bits/unique_ptr.h:163:33:   required from 'class std::unique_ptr<toco::Operator>'
tensorflow/contrib/lite/toco/graph_transformations/read_fake_quant_min_max.cc:46:56:   required from here
/usr/include/c++/7/type_traits:1553:12: internal compiler error: in layout_decl, at stor-layout.c:600
     struct remove_const
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions.
Target //tensorflow/tools/pip_package:build_pip_package failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 412.981s, Critical Path: 61.35s
FAILED: Build did NOT complete successfully

Full Disclosure: I am an employee of Qualcomm Canada, any opinions I may have expressed in this or any other post may not reflect the opinions of my employer.

I was able to cross compile a whl file for the dragonboard410c that worked. I based it off of this https://github.com/lhelontra/tensorflow-on-arm

I can send you the whl file if you need it.

1 Like

Can you send me the wheel file for dragon board?