Jetson Nano Installation TensorFlow GPU Tutorial

Today's goal is to install the TensorFlow GPU version. To install the TensorFlow GPU version, CUDA needs to be successfully configured. For those that have not been configured, please refer to tutorial 1. However, before installing TensorFlow GPU, there are some installation packages that machine learning must use that also need to be installed. Please note that the configured image has TensorFlow installed and does not require installation.

1.Install pip

Because Python version 3.6 is already installed in Jetson Nano, installing pip is still relatively simple

After installation, PIP is an older version and needs to be upgraded to the latest version

python3 -m pip install --upgrade pip

Display after successfully running pip3- V

2.Install packages that are very important in the field of machine learning

sudo apt-get install python3-numpy

(It is an extension library of the Python language that supports a large number of dimensional arrays and matrix operations. In addition, it also provides a large number of mathematical function libraries for array operations.)

sudo apt-get install python3-scipy

(Scipy is a common software package used in the fields of mathematics, science and engineering, which can deal with interpolation, integration, optimization, image processing, numerical solution of ordinary differential equation, signal processing and other problems.)

sudo apt-get install python3-pandas

Pandas is a tool based on NumPy, created to solve data analysis tasks. Pandas incorporates a large number of libraries and standard data models, providing the tools needed to efficiently manipulate large datasets. Pandas provides a large number of functions and methods that enable us to process data quickly and quickly. You will soon discover that it is one of the important factors that make Python a powerful and efficient data analysis environment

sudo apt-get install python3-matplotlib

Matplotlib is a Python 2D drawing library that generates publication quality graphics in various hardcopy formats and cross platform interactive environments

sudo apt-get install python3-sklearn

(Simple and efficient data mining and analysis tools)

3.Install TensorFlow GPU version

(1) Confirm that CUDA has been installed properly

nvcc -V

If you can see the CUDA version number, it indicates correct installation

If an error is reported, refer to this link for a solution

https://zhuanlan.zhihu.com/p/513220749

Install the required packages

sudo apt-get install libhdf5-serial-dev hdf5-tools libhdf5-dev zlib1g-dev zip libjpeg8-dev liblapack-dev libblas-dev gfortran

Installing Python dependencies

sudo pip3 install -U numpy==1.16.1 future==0.18.2 mock==3.0.5 h5py==3.10.0 keras_preprocessing==1.1.1 keras_applications==1.0.8 gast==0.2.2 futures protobuf pybind11

Install TensorFlow GPU version (online installation is often interrupted, it is recommended to use offline installation)

in-line

sudo pip3 install --pre --extra-index-url

https://developer.download.nvidia.com/compute/redist/jp/v461

tensorflow

The following are the installation instructions for TensorFlow on the official website

https://docs.nvidia.com/deeplearning/frameworks/install-tf-jetson-platform/index.html#install

Offline installation

Because online installation and download are too slow, we can choose to install the offline package. The installation package needs to be downloaded online. The corresponding TensorFlow needs to be installed based on the JetPack version of the current system. In our environment, there is also an offline package stored in the attachment, but it needs to be checked to see if it matches the Jetpack version of your current system.

https://docs.nvidia.com/deeplearning/frameworks/install-tf-jetson-platform-release-notes/tf-jetson-rel.html#tf-jetson-rel

 

  1. Upload the WHL file directly through the winSCP software to the/home/nano folder on Jeston nano
  2. After uploading, enter the command (pip3 install+your corresponding version installation package)pip3 install xxx.whlDuring the download process, it may also be necessary to install some software packages online and directly pass through Y (YES).
  3. Complete the installation and enter the following command to check if TensorFlow has been successfully installed.

python3

import tensorflow as tf

No errors were reported, indicating successful installation.

appendix

Other reference tutorials:https://blog.csdn.net/yihuajack/article/details/121234463