From AutonomousPrime Senior Design
Jump to: navigation, search


We used an Odroid for the initial onboard computer. Using this system allowed us to start quick prototyping. However this required some extra work as the Odroid operates in a 32 bit environment.

Getting Started

You will need to download an operating system. We used Ubuntu 14.04 15.10 LTS, as it is a lightweight system, easy to use, and it also is able to run all of the software we need (Tensorflow and Keras along with standard programs like python and java). We have also used Ubuntu 16.04 for the eMMC module (it was pre-installed). Unfortunately this version of Ubuntu runs on a different kernel and required Tensorflow to be compiled.

Installing Tensorflow

 sudo apt-get update
# For Python 2.7
sudo apt-get install python-pip python-dev

# For Python 3.3+
sudo apt-get install python3-pip python3-dev

  • Install dependencies
  • Download the wheel from the proper repository
For 2.7
wget https://github.com/samjabrahams/tensorflow-on-raspberry-pi/releases/download/v1.0.1/tensorflow-1.0.1-cp27-none-linux_armv7l.whl
sudo pip install tensorflow-1.0.1-cp27-none-linux_armv7l.whl

For 3.3+
wget https://github.com/samjabrahams/tensorflow-on-raspberry-pi/releases/download/v1.0.1/tensorflow-1.0.1-cp34-cp34m-linux_armv7l.whl
sudo pip3 install tensorflow-1.0.1-cp34-cp34m-linux_armv7l.whl

  • Have to reinstall the mock library to stop it from throwing errors
 sudo pip uninstall mock
sudo pip install mock

  • To test
$ python
>>> import tensorflow as tf

>>> hello = tf.constant('Hello, TensorFlow!')
>>> sess = tf.Session()
>>> print(sess.run(hello))

Installing OpenCV 3 for Python 3.4

Install Prerequisites:

 sudo apt-get update
 sudo apt-get upgrade
sudo apt-get install build-essential cmake git pkg-config sudo apt-get install libjpeg8-dev libtiff5-dev libjasper-dev libpng12-dev sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev libv4l-dev sudo apt-get install libgtk2.0-dev sudo apt-get install libatlas-base-dev gfortran

Setup Python:

 wget https://bootstrap.pypa.io/get-pip.py
 sudo python3 get-pip.py
sudo apt-get install python3.4-dev pip install numpy

Install and Build OpenCV 3.1.0:

 cd ~
 mkdir opencv_tmp
 cd opencv_tmp
 git clone https://github.com/Itseez/opencv.git
 cd opencv
 git checkout 3.1.0
cd ~ mkdir opencv_contrib_tmp cd opencv_contrib_tmp git clone https://github.com/Itseez/opencv_contrib.git cd opencv_contrib git checkout 3.1.0
cd ~/opencv_tmp/opencv mkdir build cd build cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREVIX=/usr/local -D INSTALL_C_EXAMPLES=OFF -D INSTALL_PYTHON_EXAMPLES=ON -D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib_tmp/opencv_contrib/modlules -D BUILD_EXAMPLES=ON ..
make -j4
sudo make install sudo ldconfig

External Resources:

Helpful Links

Return to Main Page