Install TensorFlow

Today's goal is to install the TensorFlow GPU version. To install the TensorFlow GPU version, you need to successfully configure CUDA. However, before installing TensorFlow GPU, you also need to install some installation packages that are necessary for machine learning.

Note: The factory image has already installed tensorflow, so there is no need to install it.

Because Jetson Orin NX and Jetson Orin Nano use Docker technology, there is currently no function to install TensorFlow GPU. Therefore, this course is only valid for Jetson Nano motherboards.

1. Install pip

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

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

After running pip3 -V successfully, it will display image-2023040400001

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

(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.)

(Scipy is a commonly used software package for mathematics, science, and engineering that can handle interpolation, integration, optimization, image processing, numerical solution of ordinary differential equations, signal processing, and other problems.)

(pandas is a tool based on NumPy that was created to solve data analysis tasks. Pandas incorporates a large number of libraries and some standard data models, providing the tools needed to efficiently operate large data sets. Pandas provides a large number of functions and methods that allow us to process data quickly and easily. You will soon find that it is one of the important factors that make Python a powerful and efficient data analysis environment.)

(Matplotlib is a Python 2D plotting library that produces publication-quality graphics in a variety of hardcopy formats and cross-platform interactive environments)

(Simple and efficient data mining and data analysis tool)

3. Install TensorFlow GPU version

(1) Confirm that CUDA has been installed normally

If you can see the CUDA version number, it is installed correctly image-2023040400002 If an error occurs, refer to this link for a solution https://zhuanlan.zhihu.com/p/513220749

Install the required packages

Install Python dependencies

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

(3.1) Online installation sudo pip3 install --pre --extra-index-url https://developer.download.nvidia.com/compute/redist/jp/v46 tensorflow

The following is the tensorflow installation instructions on the official website. https://docs.nvidia.com/deeplearning/frameworks/install-tf-jetson-platform/index.html#install

(3.2) Offline installation

Because the online installation download is too slow, we can choose to install the offline package. The installation package needs to be downloaded from the Internet. You need to install the corresponding TensorFlow according to the JetPack version of the current system. There is also an offline package in our environment construction attachment, but you need to check whether 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 image-20240628195224158

1) Upload the WHL file directly to the /home/jetson folder on jetson nano through winSCP software.

2) After uploading, enter the command (pip3 install + your corresponding version installation package)

During the download, you may also need to install some software packages online. Just click Y (YES) to pass.

3) After the installation is complete, enter the following command to view the version number

image-20240628195322709

4) Enter the following command to check whether tensorflow is successfully installed.

image-20240628195529790

No error is reported, which means the installation is successful.

Appendix

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