You are on page 1of 17

dog: 0.7677 dog: 0.8134 dog: 0.

8991

Convolutional
Neural
Networks
dog: 0.7411 dog: 0.9341 dog: 0.9279
for
Image
Classification
dog: 0.8557 dog: 0.8712 dog: 0.8018

Software
Installation &
Verification

Software Installation & Verification


“Install needed prerequisites for the course. Verify successful installation.”
Content

Flowchart .................................................................................................................. 2
Miniconda .................................................................................................................. 3
Environments............................................................................................................. 4
Keras ........................................................................................................................ 5
Jupyter Notebook ....................................................................................................... 6
FFmpeg..................................................................................................................... 7
OpenCV .................................................................................................................... 8
Scikit-learn ................................................................................................................ 9
Matplotlib ................................................................................................................. 10
Pandas ..................................................................................................................... 11
Tqdm ....................................................................................................................... 12
Pydot ....................................................................................................................... 13
Git........................................................................................................................... 14
Numpy ..................................................................................................................... 15
h5py ........................................................................................................................ 16
PyCharm .................................................................................................................. 17
Software Installation & Verification
Flowchart

Page 2
Software Installation & Verification
Miniconda
Miniconda is a minimal installer for conda.
Conda is a package manager system, as well as an environment management system.
Conda works on Linux, Windows and macOS.

Table 1. Installation instructions for Miniconda


Linux Windows macOS

Download Miniconda installer Download Miniconda installer Download Miniconda installer


from official resource (Linux from official resource (Win from official resource (macOS
and Python v3): here and Python v3): here and Python v3): here

Open Terminal Window and Open Explorer and find the Open Terminal Window and
navigate to the folder with downloaded file, for example: navigate to the folder with
downloaded file, for example: Miniconda3-latest-Windows- downloaded file, for example:
cd Downloads x86_64.exe cd Downloads

Run installation, for example: Run installation, for example:


bash name-of-the-file bash name-of-the-file
Run installation process by
Should look like following: double-click on the file Should look like following:
bash Miniconda3-latest-Linux- bash Miniconda3-latest-MacOSX-
x86_64.sh x86_64.sh

Follow the prompts Follow the prompts Follow the prompts

Open Anaconda Prompt from


Re-open Terminal Window Re-open Terminal Window
the Start menu

Verify installation by following Verify installation by following Verify installation by following


command: conda list command: conda list command: conda list

Links:
Check out additional links with useful instructions for further readings

✓ Miniconda

✓ Installing on Linux

✓ Installing on Windows

✓ Installing on macOS:

✓ Conda

Page 3
Software Installation & Verification
Environments
Open Terminal Window on Linux system. If you’re on macOS, then also open Terminal. If you’re
on Windows, then open Anaconda Prompt. All the commands are the same for Linux, macOS
and Windows.

Table 2. Managing environments by conda


Command Description

Creates new environment with name ‘cnncpu’


conda create --name cnncpu python=3.7
and Python version 3.7

conda activate cnncpu Activates environment with name ‘cnncpu’

conda activate Activates base environment

conda info --envs Prints list of all environments

Removes environment with name ‘test’ and all


conda remove --name test --all
installed packages inside it

Prints list of packages that are currently


conda list installed in the currently activated
environment

Links:
Check out additional links with useful instructions for further readings

✓ Conda documentation

✓ Managing environments

Page 4
Software Installation & Verification
Keras
Keras is a high-level neural networks library. It allows to implement experiments very fast:
from idea to output results.

Open Terminal Window on Linux system. If you’re on macOS, then also open Terminal. If you’re
on Windows, then open Anaconda Prompt. All the commands are the same for Linux, macOS
and Windows.

Table 3. Installation instructions for Keras and CPU


Command Description

Activates environment with name


conda activate cnncpu
‘cnncpu’

Installs Keras for CPU usage only


conda install -c anaconda keras
from Anaconda cloud

Verifies successful installation of


python -c "import keras; print(keras.__version__)"
Keras

Table 4. * Installation instructions for Keras and GPU (if there is Nvidia card)
Command Description

Activates environment with name


conda activate cnngpu
‘cnngpu’

Installs Keras for GPU (Nvidia card)


conda install -c anaconda keras-gpu
from Anaconda cloud

Verifies successful installation of


python -c "import keras; print(keras.__version__)"
Keras

* Optional, if there is Nvidia card. The command will automatically install all needed toolkits for
Nvidia card, such as CUDA, cuDNN and others.

Links:
Check out additional links with useful instructions for further readings

✓ Keras

✓ Keras for CPU from Anaconda cloud

✓ Keras for GPU from Anaconda cloud

Page 5
Software Installation & Verification
Jupyter Notebook
Jupyter Notebook is an Interactive Computational Environment. It allows to run every cell of
the code separately without need to run entire file at once. Jupyter Notebook is a web-based
programming environment.

Open Terminal Window on Linux system. If you’re on macOS, then also open Terminal. If you’re
on Windows, then open Anaconda Prompt. All the commands are the same for Linux, macOS
and Windows.

Table 5. Installation instructions for Jupyter Notebook


Command Description

Activates environment with name


conda activate cnncpu
‘cnncpu’

Installs Jupyter Notebook from


conda install -c anaconda jupyter
Anaconda cloud

jupyter notebook Runs Jupyter Notebook

Links:
Check out additional links with useful instructions for further readings

✓ Jupyter

✓ Jupyter Notebook from Anaconda cloud

✓ Jupyter Notebook from Conda-forge cloud

✓ Quick Start

Page 6
Software Installation & Verification
FFmpeg
FFmpeg is a multimedia framework for processing video and other multimedia files, as well as
for creating video from set of images.

Open Terminal Window on Linux system. If you’re on macOS, then also open Terminal. If you’re
on Windows, then open Anaconda Prompt. All the commands are the same for Linux, macOS
and Windows.

Table 6. Installation instructions for FFmpeg


Command Description

Activates environment with name


conda activate cnncpu
‘cnncpu’

Installs FFmpeg from Anaconda


conda install -c anaconda ffmpeg
cloud

ffmpeg -h Verifies installation of FFmpeg

Links:
Check out additional links with useful instructions for further readings

✓ FFmpeg

✓ FFmpeg from Anaconda cloud

✓ FFmpeg from Conda-forge cloud

✓ Slideshow from images

Page 7
Software Installation & Verification
OpenCV
OpenCV is a computer vision library. It can be used to read and process images, to capture
video from camera and many other purposes.

Open Terminal Window on Linux system. If you’re on macOS, then also open Terminal. If you’re
on Windows, then open Anaconda Prompt. All the commands are the same for Linux, macOS
and Windows.

Table 7. Installation instructions for OpenCV


Command Description

Activates environment with name


conda activate cnncpu
‘cnncpu’

Installs OpenCV from Anaconda


conda install -c anaconda opencv
cloud

Verifies successful installation of


python -c "import cv2; print(cv2.__version__)"
OpenCV

Links:
Check out additional links with useful instructions for further readings

✓ OpenCV

✓ OpenCV from Anaconda cloud

✓ OpenCV from Conda-forge cloud

Page 8
Software Installation & Verification
Scikit-learn
Scikit-learn is a machine learning library. It can be used to report classification results by
different metrics.

Open Terminal Window on Linux system. If you’re on macOS, then also open Terminal. If you’re
on Windows, then open Anaconda Prompt. All the commands are the same for Linux, macOS
and Windows.

Table 8. Installation instructions for Scikit-learn


Command Description

Activates environment with


conda activate cnncpu
name ‘cnncpu’

Installs Scikit-learn from


conda install -c anaconda scikit-learn
Anaconda cloud

Verifies successful installation of


python -c "import sklearn; print(sklearn.__version__)"
Scikit-learn

Links:
Check out additional links with useful instructions for further readings

✓ Scikit-learn

✓ Scikit-learn from Anaconda cloud

✓ Scikit-learn from Conda-forge cloud

Page 9
Software Installation & Verification
Matplotlib
Matplotlib is a 2D plotting library. It allows to produce figures of an excellent quality.

Open Terminal Window on Linux system. If you’re on macOS, then also open Terminal. If you’re
on Windows, then open Anaconda Prompt. All the commands are the same for Linux, macOS
and Windows.

Table 9. Installation instructions for Matplotlib


Command Description

Activates environment
conda activate cnncpu
with name ‘cnncpu’

Installs Matplotlib from


conda install -c anaconda matplotlib
Anaconda cloud

Verifies successful
python -c "import matplotlib; print(matplotlib.__version__)"
installation of Matplotlib

Links:
Check out additional links with useful instructions for further readings

✓ Matplotlib

✓ Matplotlib from Anaconda cloud

✓ Matplotlib from Conda-forge cloud

Page 10
Software Installation & Verification
Pandas
Pandas is a library to manage data structures. It provides high-performance and is a very easy-
to-use tool.

Open Terminal Window on Linux system. If you’re on macOS, then also open Terminal. If you’re
on Windows, then open Anaconda Prompt. All the commands are the same for Linux, macOS
and Windows.

Table 10. Installation instructions for Pandas


Command Description

Activates environment with name


conda activate cnncpu
‘cnncpu’

Installs Pandas from Anaconda


conda install -c anaconda pandas
cloud

Verifies successful installation of


python -c "import pandas; print(pandas.__version__)"
Pandas

Links:
Check out additional links with useful instructions for further readings

✓ Pandas

✓ Pandas from Anaconda cloud

✓ Pandas from Conda-forge cloud

Page 11
Software Installation & Verification
Tqdm
Tqdm is a library to show smart progress bar. It helps to track the calculations inside loops in
Real Time.

Open Terminal Window on Linux system. If you’re on macOS, then also open Terminal. If you’re
on Windows, then open Anaconda Prompt. All the commands are the same for Linux, macOS
and Windows.

Table 11. Installation instructions for Tqdm


Command Description

Activates environment with name


conda activate cnncpu
‘cnncpu’

Installs Tqdm from Anaconda


conda install -c anaconda tqdm
cloud

Verifies successful installation of


python -c "import tqdm; print(tqdm.__version__)"
Tqdm

Links:
Check out additional links with useful instructions for further readings

✓ Tqdm

✓ Tqdm from Anaconda cloud

✓ Tqdm from Conda-forge cloud

Page 12
Software Installation & Verification
Pydot
Pydot is a library to visualize graphs. It helps to represent designed deep CNN models and see
connections between layers.

Open Terminal Window on Linux system. If you’re on macOS, then also open Terminal. If you’re
on Windows, then open Anaconda Prompt. All the commands are the same for Linux, macOS
and Windows.

Table 12. Installation instructions for Pydot


Command Description

Activates environment with name


conda activate cnncpu
‘cnncpu’

Installs Pydot from Anaconda


conda install -c anaconda pydot
cloud

Verifies successful installation of


python -c "import pydot; print(pydot.__version__)"
Pydot

Links:
Check out additional links with useful instructions for further readings

✓ Pydot

✓ Pydot from Anaconda cloud

✓ Pydot from Conda-forge cloud

Page 13
Software Installation & Verification
Git
Git is a system to control versions of designed code. It can be used to clone and download
programs from GitHub.

Open Terminal Window on Linux system. If you’re on macOS, then also open Terminal. If you’re
on Windows, then open Anaconda Prompt. All the commands are the same for Linux, macOS
and Windows.

Table 13. Installation instructions for Git


Command Description

conda activate cnncpu Activates environment with name ‘cnncpu’

conda install -c anaconda git Installs Git from Anaconda cloud

git --version Verifies successful installation of Git

Links:
Check out additional links with useful instructions for further readings

✓ Git

✓ Git from Anaconda cloud

✓ Git from Conda-forge cloud

Page 14
Software Installation & Verification
Numpy
Numpy is a fundamental package for numerical computations with Python. It is used to handle
operations with arrays.

Open Terminal Window on Linux system. If you’re on macOS, then also open Terminal. If you’re
on Windows, then open Anaconda Prompt. All the commands are the same for Linux, macOS
and Windows.

Table 14. Installation instructions for Numpy


Command Description

Activates environment with name


conda activate cnncpu
‘cnncpu’

Installs Numpy from Anaconda


conda install -c anaconda numpy
cloud

Verifies successful installation of


python -c "import numpy; print(numpy.__version__)"
Numpy

Links:
Check out additional links with useful instructions for further readings

✓ Numpy

✓ Numpy from Anaconda cloud

✓ Numpy from Conda-forge cloud

Page 15
Software Installation & Verification
h5py
h5py is a package to store data in HDF5 binary format. It can be used to save processed
datasets into files, to save and load neural network models.

Open Terminal Window on Linux system. If you’re on macOS, then also open Terminal. If you’re
on Windows, then open Anaconda Prompt. All the commands are the same for Linux, macOS
and Windows.

Table 15. Installation instructions for h5py


Command Description

Activates environment with name


conda activate cnncpu
‘cnncpu’

conda install -c anaconda h5py Installs h5py from Anaconda cloud

python -c "import h5py; print(h5py.__version__)" Verifies successful installation of h5py

Links:
Check out additional links with useful instructions for further readings

✓ h5py

✓ h5py from Anaconda cloud

✓ h5py from Conda-forge cloud

Page 16
Software Installation & Verification
PyCharm
PyCharm is a Python development environment. It makes programming easy with smart
assistance.

Table 16. Installation instructions for PyCharm (Community version)


Linux Windows macOS

Download PyCharm archive Download PyCharm installer Download PyCharm Image file
from official resource: here from official resource: here from official resource: here

Copy archive to the desired Open Explorer and find the Mount it as another disk in
location in an empty folder downloaded file your system

Open Terminal Window and


unpack the file using the Run installation process by Copy PyCharm to your
following command: double-click on the file Applications folder
tar -xzf name-of-the-file

Navigate from Terminal


Window to the sub-directory
‘bin’ and run PyCharm by Follow the prompts Run PyCharm
following command:
sh pycharm.sh

Run PyCharm from the Start


Create the Project with name Create the Project with name
menu and create the Project
‘CNNCourse’ ‘CNNCourse’
with name ‘CNNCourse’

Connect created environment Connect created environment Connect created environment


‘cnncpu’ to the Project ‘cnncpu’ to the Project ‘cnncpu’ to the Project
‘CNNCourse’ ‘CNNCourse’ ‘CNNCourse’

Links:
Check out additional links with useful instructions for further readings

✓ PyCharm

✓ Connect Python interpreter to the Project

✓ Installation guide

Page 17

You might also like