NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

# Installation of OpenCV, TensorFlow and Keras on RaspberryPi

### Hardware Requirements:
* RaspberryPi 2/3 B ( In my case i have [RPi3 V1.2](https://fccid.io/2ABCB-RPI32) )
* Micro SD card (16GB or greater) and Card Reader
* USB Charger or a powerbank to power the RPI
* Any keyboard
* HDMI cable and Monitor (to set up VNC)

### Operating system installation:
* [Download Raspbian Stretch](https://www.raspberrypi.org/downloads/raspbian/) image
* [Download Etcher](https://www.balena.io/etcher/) and flash the image on SD-Card

### After installation

* Connect to wifi
* [Check your OS version](https://www.meccanismocomplesso.org/en/how-to-raspberry-checking-raspbian-version-update-upgrade/) to make sure Raspbian Stretch was installed
* [Download VNC Viewer](https://www.realvnc.com/en/connect/download/viewer/) to access RPI headless over wifi/ethernet and follow [those instructions](https://www.realvnc.com/en/connect/docs/raspberry-pi.html) to connect

### Installation of TensorFlow with python3.5
* Get the pre-built wheel file of tensorflow and install it with pip3
* `wget https://github.com/lhelontra/tensorflow-onarm/releases/download/v1.8.0/tensorflow-1.8.0-cp35-
none-linux_armv7l.whl`
* `sudo pip3 install tensorflow-1.8.0-cp35-nonelinux_armv7l.whl`
* Check the if the installation was successful
* `Import tensorflow as tf`
* `Print(tf.__version__)`

### Installation of Keras with Python 3.5

```
sudo apt-get install python3-numpy
sudo apt-get install libblas-dev
sudo apt-get install liblapack-dev
sudo apt-get install python3-dev
sudo apt-get install libatlas-base-dev
sudo apt-get install gfortran
sudo apt-get install python3-setuptools
sudo apt-get install python3-scipy
sudo apt-get update
sudo apt-get install python3-h5py
sudo pip3 install keras
```

### Installation of OpenCV
```
sudo apt-get update && sudo apt-get upgrade
sudo apt-get install build-essential cmake pkg-config
sudo apt-get install libjpeg-dev libtiff5-dev libjasper-dev libpng12-dev
sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev libv4l-dev
sudo apt-get install libxvidcore-dev libx264-dev
sudo apt-get install libgtk2.0-dev libgtk-3-dev
sudo apt-get install libatlas-base-dev gfortran
sudo apt-get install python2.7-dev python3-dev
cd ~
wget -O opencv.zip https://github.com/Itseez/opencv/archive/3.3.0.zip
unzip opencv.zip
wget -O opencv_contrib.zip https://github.com/Itseez/opencv_contrib/archive/3.3.0.zip
unzip opencv_contrib.zip
wget https://bootstrap.pypa.io/get-pip.py
sudo python get-pip.py
sudo python3 get-pip.py
pip install numpy
cd ~/opencv-3.3.0/
mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=RELEASE
-D CMAKE_INSTALL_PREFIX=/usr/local
-D INSTALL_PYTHON_EXAMPLES=ON
-D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib-3.3.0/modules
-D BUILD_EXAMPLES=ON ..
```
Open your `/etc/dphys-swapfile` and then edit the CONF_SWAPSIZE variable:
```sh
sudo nano /etc/dphys-swapfile
```
```
CONF_SWAPSIZE=1024
```
Restart service
```sh
sudo /etc/init.d/dphys-swapfile stop
sudo /etc/init.d/dphys-swapfile start
make -j4
sudo make install
sudo ldconfig
```
**Testing OpenCV install**
```python
import cv2
print( cv2.__version__ )
```
Remove download files and reset swap size
```sh
rm -rf opencv-3.3.0 opencv_contrib-3.3.0
```

Open your `/etc/dphys-swapfile` and then change the swap_size back:
```
sudo nano /etc/dphys-swapfile
```
```
CONF_SWAPSIZE=100
```
# END
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.