Steps:
- Download Raspbian strech with desktop from RaspberryPi
- Unzip downloaded image.
- Using Win32DiskImager, flash a SDCARD (minimum 8GB) with downloaded Raspbian Stretch.
- Power up rasphberry pi with:
- Usb Mouse and Keyboard.
- Hdmi monitor
- SdCard
- MicroUsb Power spply
- Case of using Raspberry pi 2, plugin also usb wifi dongle.
- Let the Raspberry Pi power up till you see Raspbian desktop.
- Setup wireless network.
- At this stage you have python 3.5 and 2.7 installed at your system.
- Open terminal and write there:
- pip list
- pip3 list
- You will see all pacjages installedfor python 2.7 and python 3.5
- Install Tensorflow as follows:
-
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 -
# For Python 2.7
wget https://github.com/samjabrahams/tensorflow-on-raspberry-pi/releases/download/v1.1.0/tensorflow-1.1.0-cp27-none-linux_armv7l.whl
sudo pip install tensorflow-1.1.0-cp27-none-linux_armv7l.whl# For Python 3.4
wget https://github.com/samjabrahams/tensorflow-on-raspberry-pi/releases/download/v1.1.0/tensorflow-1.1.0-cp34-cp34m-linux_armv7l.whl
sudo pip3 install tensorflow-1.1.0-cp34-cp34m-linux_armv7l.whl -
Finally, we need to reinstall the mock library to keep it from throwing an error when we import TensorFlow:
# For Python 2.7
sudo pip uninstall mock
sudo pip install mock# For Python 3.3+
sudo pip3 uninstall mock
sudo pip3 install mock
-
- Run image classification with python as follows:
- Save the classification example to a python file and run it.
- This script will download inception model and it will place it under main directory/tmp/imagenet.
Keywords
Tensorflow, Python, Tensor Flow, Raspberry, Raspberry Pi, RaspberryPi, RPI