Tinker Board Forum

Full Version: TENSORFLOW AND OPENCV ON TINKERBOARD
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello I bought ASUS Tinkerboard 2GB back in January.
My Target was to use it in my project which requires character recognition using opencv and tensorflow.
Now i tried different OS and their several different versions also .
but still couldnot install both tensorflow and opencv on a same OS.Here are my experiences and difficulties
1. Debian version 2.0.8 to 2.0.3, 1.0.8: First of all there is no prebuit opencv library out for this . i tried pip install & apt-get &apt and every possible whl file out there to try the installation but none of them worked.I also tried building opencv3 and it worked but always one or two functions were not working like imshow and the its performance was very poor.However i managed to install Tensorflow following a tutorial for raspbarry pi which basically used lhelontra prebuilt whl file.
2. Armbian_5.75_Tinkerboard_Ubuntu_bionic_next_4.19.20_desktop.7z : It is better than Debian (only one mans opinion).It is basically UBUNTU 18.04 that means it has python3.6 and 2.7 by defau;t . I managed to install opencv with simply sudo apt install python3-opencv.Now on the specific require is tensorflow for python 3.6 with armv7l. i searched everywhere i could on the internet but couldn't find this version.
I TRIED CHANGING PYTHON to 3.5 but the thing is if install tensorflow on python3.5 , the above command for opencv only installs opencv
for python 3.6.So on 3.5 there is tensorflow and on3.6 there opencv.
Please suggest a suitable os or a better approach than mine.
(03-26-2019, 07:58 AM)Asfand Wrote: [ -> ]Hello I bought ASUS Tinkerboard 2GB back in January.
My Target was to use it in my project which requires character recognition using opencv and tensorflow.
Now i tried different OS and their several different versions also .
but still couldnot install both tensorflow and opencv on a same OS.Here are my experiences and difficulties
1. Debian version 2.0.8 to 2.0.3, 1.0.8: First of all there is no prebuit opencv library out for this . i tried pip install & apt-get &apt and every possible whl file out there to try the installation but none of them worked.I also tried building opencv3 and it worked but always one or two functions were not working like imshow and the its performance was very poor.However i managed to install Tensorflow following a tutorial for raspbarry pi which basically used lhelontra prebuilt whl file.
2. Armbian_5.75_Tinkerboard_Ubuntu_bionic_next_4.19.20_desktop.7z : It is better than Debian (only one mans opinion).It is basically UBUNTU 18.04 that means it has python3.6 and 2.7 by defau;t . I managed to install opencv with simply sudo apt install python3-opencv.Now on the specific require is tensorflow for python 3.6 with armv7l. i searched everywhere i could on the internet but couldn't find this version.
I TRIED CHANGING PYTHON to 3.5 but the thing is if install tensorflow on python3.5 , the above command for opencv only installs opencv
for python 3.6.So on 3.5 there is tensorflow and on3.6 there opencv.
Please suggest a suitable os or a better approach than mine.

You should probably ALSO ask this question to the Opencsv or Tensorflow people !

What you're asking is very specific, just a suggestion!
Hi Asfand,

Could you try below ?  (remove spaces)

# It uses my opencv-3.4.5 build for RPi3 which also works on TB.
# And I'm not familiar with Tensorflow, so I just tested 'Hello World' ...

# I couldn't post the article here.
# since "You cannot post clickable links to this forum threads and posts' message. Minimum post count is 25 posts. "

Updated:

Code:
# Use: 20181023-tinker-board-linaro-stretch-alip-v2.0.8.img.zip
#
# If you have apt-cacher-ng server
# echo 'Acquire::http::Proxy "http://apt-cache-server:3142";' | tee /etc/apt/apt.conf.d/02proxy

########
#Update packages except Chromium :-)
sudo sh -c 'apt-mark hold chromium && apt update && sudo apt upgrade -y'

##########
# Fix Cpu Freq : /boot/rk3288-miniarm.dtb
wget https://github.com/mt08xx/files/raw/master/TinkerOS-v2.0.8_CPUFreqFix_rk3288-miniarm.dtb.bz2 -O rk3288-miniarm.dtb.bz2
# Extract and make sure if it's correct
bzip2 -d rk3288-miniarm.dtb.bz2
md5sum rk3288-miniarm.dtb
# => ce70fbd5cf42cc3e4d9728612837887e  rk3288-miniarm.dtb

# backup and copy to /boot
sudo mv /boot/rk3288-miniarm.dtb{,.bak}
sudo cp ./rk3288-miniarm.dtb /boot

##########
sudo reboot
##########


##########
# Install OpenCV
wget http://ftp.us.debian.org/debian/pool/main/j/jasper/libjasper1_1.900.1-debian1-2.4+deb8u3_armhf.deb
sudo apt install ./libjasper1_1.900.1-debian1-2.4+deb8u3_armhf.deb
#
OPENCV_DEB=libopencv3_3.4.5-20181227.1_armhf.deb
curl -SL https://github.com/mt08xx/files/raw/master/opencv-rpi/${OPENCV_DEB} -o ${OPENCV_DEB}
sudo apt autoremove -y libopencv{3,4} # when old one is installed
sudo apt install -y ./${OPENCV_DEB}


##########
# Install Tensorflow
# Using: https://github.com/lhelontra/tensorflow-on-arm/releases

curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
sudo python3 ./get-pip.py

# Use piwheels
cat << EOF | sudo tee /etc/pip.conf
[global]
extra-index-url=https://www.piwheels.org/simple
EOF

wget https://github.com/lhelontra/tensorflow-on-arm/releases/download/v1.13.1/tensorflow-1.13.1-cp35-none-linux_armv7l.whl
sudo pip3 --no-cache-dir install ./tensorflow-1.13.1-cp35-none-linux_armv7l.whl


https://qiita.com/mt08/items/c32b0a0fbe82d0acb19c
(03-26-2019, 11:03 PM)mt08 Wrote: [ -> ]Hi Asfand,

Could you try this ?  (remove spaces)

> https://     qiita.com/      mt08/items/c32b0a0fbe82d0acb19c

# It uses my opencv-3.4.5 build for RPi3 which also works on TB.
# And I'm not familiar with Tensorflow, so I just tested 'Hello World' ...


# I couldn't post the article here.
# since "You cannot post clickable links to this forum threads and posts' message. Minimum post count is 25 posts. "

wow, the minimum posts count set at 25 was kind of too much. let me take a check.
(since too many spam & bot, and "No-Links" this mybb plugin also very not stable...but anyway should set count to lower.)

-- update --
"No-Links" this plugin...as I found from the setting, it should already turn "OFF" not enabled...
But I also change the minimum count number to 3.
Hi mt08,
I am currently running Armbian stretch(Debian 9)
i have build opencv 3.4.2 but was having problems installing libjasper-dev .So i skipped it and went through with the installation .Although opencv was imported and also was working but still i coouldn't fps and size etc.
I see that you managed to install libjasper and opencv as well .Gonna try your method soon and will get back to you .
As for tensorflow i had no problem installing it since its arm file for python3.5 is already available.
Thanks for your work (y)