At present, the latest JetPack4.4, TensorFlow version is updated to version 2.1.0, and the original TensorFlow-gpu is changed to tensorflow...JetsonNano platform only supports Python 3.6 TensorFlow.
From Waveshare Electronics: Jetson Nano Series Tutorial 6: Introduction to TensorFlow (1)
① Log in to Jetson Nano and install the related function library;
Note: When inputting the second instruction related function library, an error may occur due to network delay. If there is such a phenomenon, it is recommended that you disassemble the instructions and install them manually one by one
sudo apt-get update
sudo apt-get install libhdf5-serial-dev hdf5-tools libhdf5-dev zlib1g-dev zip libjpeg8-dev liblapack-dev libblas -dev gfortran
②, update pip3;
sudo apt-get install python3-pip
sudo pip3 install -U pip testresources setuptools
③, install the TensorFlow dependency library, the version corresponding to the requirement, pay attention to the version of the TensorFlow corresponding to the required version of the dependency library (click here Inquiry), if there is an interruption due to network delay, it is recommended to split the instructions to install one by one;
sudo pip3 install -U numpy1.16.1 future0.17.1 mock3.0.5 h5py2.9.0 hard_preprocessing1.0.5 keras_applications1.0.8 gast==0.2.2 futures protobuf pybind11
④. Download and install tensorflow. As of 200515, currently for the latest JetPack4.4, the TensorFlow version is updated to version 2.1.0, and the original TensorFlow-gpu is changed to tensorflow. Here we directly download the latest version. After the download is complete, you can import tensorflow to test it;
sudo pip3 install --pre --no-cache-dir --extra-index-url https://developer.download.nvidia.com/compute /redist/jp/v44 tensorflow
Install Start...
sudo pip3 install --pre --no-cache-dir --extra-index-url https://developer.download.nvidia.com/compute/redist/jp/v44 tensorflow
But in the next installation, it always fails when installing a dependent software scipy. From the printed log, it can be seen that some libraries have not been installed. So the next priority is to solve the problem of scipy's software dependency library, in order to continue the installation of TemsorFlow.
lapack_opt_info:
lapack_mkl_info:
libraries mkl_rt not found in ['/usr/local/lib', '/usr/lib', '/usr/lib/aarch64-linux-gnu']
NOT AVAILABLE
openblas_lapack_info:
libraries openblas not found in ['/usr/local/lib', '/usr/lib', '/usr/lib/aarch64-linux-gnu']
What is scipy? Some of its dependent libs are installed as follows:
pip3 install Cython
sudo apt-get install gfortran
sudo apt-get install libopenblas-dev liblapack-dev libatlas-base-dev libblas-dev
I also encountered some problems when installing these dependent libs. liblapack-dev and libblas-dev are not available, but is referred to by another package.This may mean that the package is missing, has been obsoleted, or is only available from another source. Even after update and upgrade several times, the situation remains the same. I had to try another source. Currently, the source of the University of Science and Technology of China is used.
sudo apt-get install libopenblas-dev liblapack-dev libatlas-base-dev libblas-dev
[sudo] password for colin:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package liblapack-dev is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
Package libblas-dev is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'liblapack-dev' has no installation candidate
E: Package 'libblas-dev' has no installation candidate
Change the software update source, the source of Wudaokou:
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic main multiverse restricted universe
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-security main multiverse restricted universe
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-updates main multiverse restricted universe
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-backports main multiverse restricted universe
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic main multiverse restricted universe
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-security main multiverse restricted universe
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-updates main multiverse restricted universe
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-backports main multiverse restricted universe
Yo roar! Lib can be found.
Then install scipy next.
After OK, install TemsorFlow again.
pip3 install --pre --no-cache-dir --extra-index-url https://developer.download.nvidia.com/compute/redist/jp/v44 tensorflow
The installation is successful, but there may still be some package dependency incompatibility issues. Check: We recommend you use --use-feature=2020-resolver to test your packages with the new resolver before.
ERROR: After October 2020 you may experience errors when installing or updating packages. This is because pip will change the way that it resolves dependency conflicts.
We recommend you use --use-feature=2020-resolver to test your packages with the new resolver before it becomes the default.
tensorflow-gpu 2.0.0+nv19.11.tf2 requires gast==0.2.2, but you'll have gast 0.3.3 which is incompatible.
tensorflow-gpu 2.0.0+nv19.11.tf2 requires tensorboard<2.1.0,>=2.0.0, but you'll have tensorboard 2.3.0 which is incompatible.
tensorflow-gpu 2.0.0+nv19.11.tf2 requires tensorflow-estimator<2.1.0,>=2.0.0, but you'll have tensorflow-estimator 2.3.0 which is incompatible.
pip3 install --pre --no-cache-dir --extra-index-url https://developer.download.nvidia.com/compute/redist/jp/v44 tensorflow --use-feature=2020-resolver
Add the --use-feature=2020-resolver parameter, and run the installed cmd again. The main purpose here is to check instead of reinstalling. It doesn't take much time. After the check is over, try to check the installation of TemsorFlow and open python.
imort tensorflow
print(tf.__version__)
Installation tutorial reference:
https://www.waveshare.net/study/article-889-1.html