Edited at

[Memo] OpenCV3 + Tensorflow on Tinkerboard

# 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