Install TensorFlow
Today's goal is to install TensorFlow GPU version, which requires successful CUDA configuration. 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.8 is already installed in Jetson Orin nano, installing pip is still relatively simple
sudo apt-get install python3-pip python3-dev
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 conveniently. 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
Install the required packages
xxxxxxxxxx
sudo apt-get install python3-pip
sudo python3 -m pip install --upgrade pip
sudo pip3 install -U testresources setuptools==65.5.0
Installing Python dependencies
xxxxxxxxxx
$ sudo pip3 install -U numpy==1.22 future==0.18.2 mock==3.0.5 keras_preprocessing==1.1.2 keras_applications==1.0.8 gast==0.4.0 protobuf pybind11 cython pkgconfig packaging h5py==3.6.0
Install TensorFlow GPU version (online installation is often interrupted, it is recommended to use offline installation)
(3.1)in-line
$ sudo pip3 install --extra-index-url https://developer.download.nvidia.com/compute/redist/jp/v51 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
(3.2)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.
1)Upload WHL files directly through winSCP software to folder /home/jetson on Jeston Orin nano
2)After uploading, enter the command (pip3 install+your corresponding version installation package)
pip3 install xxx.whl
During 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.
Other reference tutorials: https://forums.developer.nvidia.com/t/official-tensorflow-for-jetson-nano/71770 https://docs.nvidia.com/deeplearning/frameworks/install-tf-jetson-platform/index.html#install