Install TensorFlow 2.4 on Jetson Nano.
TensorFlow 2.5.0 was released on May 12, 2021. TensorFlow 2.5.0 is dependent on CUDA 11.0 and cuDNN version 8.0.4, both not yet available for the Jetson Nano. A workaround is cumbersome and probably not very reliable. Better to wait for the new JetPack to be released with the required versions of CUDA and cuDNN. Continue to use TensorFlow 2.4.1 for now.
This guide will guide you through the installation of TensorFlow 2.4.0 or TensorFlow 2.4.1 on a Jetson Nano.
TensorFlow is a large software library specially developed for deep learning. It consumes a vast amount of resources. You can execute TensorFlow on a Jetson Nano, but don't expect miracles. It can run your models, if not too complex, but it will not be able to train new models. Nor can it perform the so-called transfer learning. In addition to running your pre-built deep learning models, you may use the library to convert so-called frozen TensorFlow models to TensorFlow Lite flat buffer models.
If you only want to get some impression of deep learning, please consider installing TensorFlow Lite. It is much faster and uses far fewer recourses, as being designed for mobile phones and small computers like a Jetson Nano. There are many ready build models you can use. See our installation guide here.
We discuss two installations, one for Python 3 and one C++ API library.
At the time of writing (December 2020), we were experiencing some issues with Numpy. When building TensorFlow from scratch we encounter '//tensorflow/python:bfloat16_lib' failed errors. It is related to using the latest Numpy version in conjunction with CUDA, as shown in GitHub ticket #40688.
We strongly recommend checking your Numpy version with pip3 list | grep numpy. If you have installed a version higher than 1.18.5, downgrade using pip3 uninstall numpy && pip3 install numpy==1.18.5.
Incidentally, the problems only occur if you use CUDA support. If you build TensorFlow without the CUDA backend, the latest version of Numpy (1.19.4) will work just fine.
Keep this also in mind when installing other software packages on your Jetson Nano. Unintended, they might upgrade your Numpy to later versions.
TensorFlow is installed by a Google software installer called Bazel. In the end, Bazel generates a wheel to install the TensorFlow Python version or a tarball when it comes to installing the C++ version. We have posted the Bazel outcomes on our GitHub page. Feel free to use these shortcuts. The whole TensorFlow installation procedure from start to end takes many hours (±50 for Python, ±10 for the C++ library, overclocked to 1900 MHz). With all the tedious work already done, it takes still one hour and twenty minutes to install TensorFlow 2.4.0 on your Nano. For the diehards, the complete procedure is covered later in this manual.
TensorFlow 2.4 for Python 3.
The whole shortcut procedure is found below. The wheel was too large to store at GitHub, so Google drive is used. Please make sure you have latest pip3 and python3 version installed, otherwise, pip may come with the message ".whl is not a supported wheel on this platform".The installation will require about 2.1 GByte of disk space.
JetPack 4 comes with Python 3.6.9. Undoubtedly, the Python version will upgrade over time and you will need a different wheel. See out GitHub page for all the wheels.