Synopsis
To whom needs GPU version of TensorFlow running on NVIDIA Jetson.
Prerequisite checklist
- Check model of embedded board
- Prepare a virtual python environment (e.g., miniforge3), it’s not suggested to follow NVIDIA official version of guideline to install code by sudo (which may mess up system python environments).
- Check pre-built binary files on Jetson binaries, if there are some appropriate prebuilt wheels, then download them. Make sure to rename them into the formate like “tensorflow-2.10.0+nv22.10-cp38-cp38-linux_aarch64.whl”.
- Run the following code:
1
2
3
4
5
6
7
8
9
10
11sudo apt-get update
sudo apt install python3-dev python3-pip
sudo apt-get install libhdf5-serial-dev hdf5-tools libhdf5-dev zlib1g-dev zip libjpeg8-dev liblapack-dev libblas-dev gfortran
sudo apt-get install python3-pip
for AGX with Jetpack 5.0.2, python 3.8.10 is suggested.
conda create -n pytorch_env python=3.8.10
conda activate pytorch_env
pip install pip testresources setuptools
install by wheel file (example for Jetpack 5.0.2)
pip install tensorflow-2.10.0+nv22.10-cp38-cp38-linux_aarch64.whl
For tensorflow 1.x, tensorflow-1.15.5+nv22.12-cp38-cp38-linux_aarch64.whl is suggested.
Install by source code (not suggested)
Unless you really need some typical version of TensorFlow, otherwise to build a PyTorch wheel is really unnecessary (time-consuming, bug-filled, lack of documents)
1 | git clone https://github.com/tensorflow/tensorflow |