Tensorflow installation on Odroid-HC1
Hardkernel.com has very powerful board for HomeNAS solution:
Key features
* Samsung Exynos5422 Cortex-A15 2Ghz and Cortex-A7 Octa core CPUs
* 2Gbyte LPDDR3 RAM PoP stacked
* SATA-3 port for 2.5inch HDD/SSD storage up to 15mm thickness
* Gigabit Ethernet port
Also it shows good performance copmaring with other boards (RPi)
It’s very interesting to check Tensorflow performance on this board. Main question — how to install it on the board — TF has not official support for Odroid.
Lets start.
- Install Bare OS — Ubuntu 16.04.3 from official site https://wiki.odroid.com/odroid-xu4/os_images/linux/ubuntu_4.14/ubuntu_4.14
- Download. Prepare SD card (8–16Gb). Write image to SD (Win32Disk or Etcher)
- Insert SD to Board. Plug power with proper Power supply adapter (5v, 2,5Amps minimum for start — 4Amps must have for TF hard computation) and Router internet cable.
- After proper system start blu led will be flashing twice with about 1Hz frequency.
- Check DHCP router address. Use SSH to connect to Board with this address.
- login: root pass: odroid
- create odroid — new user
$sudo useradd odroid
$sudo passwd odroid
$sudo mkdir /home/odroid
$sudo chown odroid /home/odroid
$sudo chgrp odroid /home/odroid - grant sudo privileges
$visudo
add after string
root ALL=ALL(ALL:ALL) ALL
odroid ALL=ALL(ALL:ALL) ALL - $sudo apt-get upgdate
$sudo apt-get-upgrade
10. install pip3 for TF installation.
$sudo apt-get install python3-pip
check pip3 — if some problem occured reinstall it with
$sudo python3 -m pip uninstall pip && sudo apt install python3-pip — reinstall
11. start TF installation (it will be simple :))
first install all dependencies for TF
$sudo apt-get install openjdk-8-jdk automake autoconf
$sudo apt-get install curl zip unzip libtool swig libpng12-dev pkg-config git zip g++ unzip wget xz-utils
$sudo -H pip3 install — upgrade pip
before start pip3 check
$sudo nano /usr/bin/pip3
You can see:
import sys
from pip import main
if __name__ == ‘__main__’:
sys.exit(main())
Change to:
import sys
from pip import __main__
if __name__ == ‘__main__’:
sys.exit(__main__._main())
after check pip3 it can run without mistakes
get wheel:
$sudo pip3 install tensorflow-1.12.0-cp35-none-linux_armv7l.whl
during installation iit will be mistake with h5py
to fix it need to install h5py
$sudo apt-get install python3-h5py
after that start installation of tensorflow again
$sudo pip3 install tensorflow-1.12.0-cp35-none-linux_armv7l.whl
tersorflow installed but with first start return
ImportError: /usr/lib/arm-linux-gnueabihf/libstdc++.so.6: version
`GLIBCXX_3.4.22' not found (required by /usr/local/lib/python3.5/dist-packages/tensorflow/python/_pywrap_tensorflow_internal.so)
Failed to load the native TensorFlow runtime.
to fix it try to install
$sudo apt install libstdc++6
check after installation
strings /usr/lib/arm-linux-gnueabihf/libstdc++.so.6 | grep GLIBCXX
have not found GLIBCX_3.4.22
if string GLIBCXX_3.4.22 not existed need to
$sudo add-apt-repository ppa:ubuntu-toolchain-r/test
$sudo apt-get update
$sudo apt-get upgrade
and after that again install
$sudo apt install libstdc++6
after that command
$strings /usr/lib/arm-linux-gnueabihf/libstdc++.so.6 | grep GLIBCXX
returns
GLIBCXX_3.4.20
GLIBCXX_3.4.21
GLIBCXX_3.4.22
GLIBCXX_3.4.23
GLIBCXX_3.4.24
GLIBCXX_3.4.25
GLIBCXX_DEBUG_MESSAGE_LENGTH
Good.
Check tensorflow
$python3
>>import tensorflow