Jetson nano 2G, primeira abordagem

Parece que consegui instalar o tensorflow gpu acelerated

Link com a instalação oficial

https://docs.nvidia.com/deeplearning/frameworks/install-tf-jetson-platform/index.html

Link com a lista de versões e depencias na ultima versão.

https://docs.nvidia.com/deeplearning/frameworks/install-tf-jetson-platform-release-notes/tf-jetson-rel.html#tf-jetson-rel

 

Burn sdcard

sudo apt update
sudo apt upgrade
sudo apt install nvidia-jetpack
sudo apt install nano locate mc screen terminator

(.bashrc) export PATH=”$PATH:/usr/local/cuda-10.2/bin”

# tensor flow jetson nano official
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
pip3 install -U pip testresources setuptools==49.6.0
pip3 install -U numpy==1.16.1 future==0.18.2 mock==3.0.5 h5py==2.10.0 keras_preprocessing==1.1.1 keras_applications==1.0.8 gast==0.2.2 futures protobuf pybind11
# TF-2.x
pip3 install –pre –extra-index-url https://developer.download.nvidia.com/compute/redist/jp/v45 tensorflow

WARNING: The scripts f2py, f2py3 and f2py3.6 are installed in ‘/home/inaciose/.local/bin’ which is not on PATH.

# ERRORs after official install

python3
Python 3.6.9 (default, Jan 26 2021, 15:33:00)
[GCC 8.4.0] on linux
Type “help”, “copyright”, “credits” or “license” for more information.
>>> import cv2
Illegal instruction (core dumped)

# UNINSTALL pip3 uninstall tensorflow

pip3 uninstall tensorflow (desinstalar so o tensorflow now resolveu)

pip3 uninstall numpy==1.16.1 future==0.18.2 mock==3.0.5 h5py==2.10.0 keras_preprocessing==1.1.1 keras_applications==1.0.8 gast==0.2.2 futures protobuf pybind11

pip3 uninstall pip testresources setuptools==49.6.0

Reinstall diferently (I dont know why but these packages installed very slowly)

pip3 install cython

pip3 install numpy

pip3 install pandas (saltei no 4g pois dava error)

pip3 install sklearn

pip3 install grpcio absl-py (saltei no 4g)

pip3 install six mock requests gast

pip3 install h5py==2.10.0 (install without version indication, give  compilation error. View ERROR install h5py) (saltei no 4g)

pip3 install astor termcolor protobuf

pip3 install h5py==2.10.0 numpy==1.19.5 keras_preprocessing==1.1.2 keras_applications==1.0.8 wrapt (saltei no 4g)

pip3 install h5py==2.10.0 numpy==1.19.5 keras_preprocessing==1.1.2 keras_applications==1.0.8 wrapt google-pasta setuptools testresources

pip3 install –pre –extra-index-url https://developer.download.nvidia.com/compute/redist/jp/v45 tensorflow

# TEST VERSION DISPLAY

>>>  import tensorflow as tf
2021-07-20 17:34:38.831270: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Successfully opened dynamic library libcudart.so.10.2

>>> print(tf.__version__)
2.5.0

 

# ERROR import wrong order
import cv2
libgomp.so.1: cannot allocate memory in static TLS block

SOLUTION
>>> import cv2
>>> cv2.__version__
‘4.1.1’

 

>>> gpu_available = tf.test.is_gpu_available()

Created TensorFlow device (/device:GPU:0 with 58 MB memory) -> physical GPU (device: 0, name: NVIDIA Tegra X1, pci bus id: 0000:00:00.0, compute capability: 5.3)

>>> print (gpu_available)
True

>>> is_cuda_gpu_available = tf.test.is_gpu_available(cuda_only=True)

Created TensorFlow device (/device:GPU:0 with 58 MB memory) -> physical GPU (device: 0, name: NVIDIA Tegra X1, pci bus id: 0000:00:00.0, compute capability: 5.3)

>>> print (is_cuda_gpu_available)
True

>>> is_cuda_gpu_min_3 = tf.test.is_gpu_available(True, (3,0))

Created TensorFlow device (/device:GPU:0 with 58 MB memory) -> physical GPU (device: 0, name: NVIDIA Tegra X1, pci bus id: 0000:00:00.0, compute capability: 5.3)

>>> print (is_cuda_gpu_min_3)
True

 

# versions required as stated in the next link:

numpy==1.19.4, future==0.18.2, mock==3.0.5, h5py==2.10.0, gast==0.2.2, keras_preprocessing==1.1.2, keras_applications==1.0.8, scipy==1.4.1

#ERROR install h5py

numpy/core/src/multiarray/numpyos.c:18:10: fatal error: xlocale.h: No such file or directory
#include <xlocale.h>

# VERSIONS INSTALED

Ubuntu 18.04.5 LTS (Bionic Beaver)

nvidia-jetpack v 4.5.1-b129

Docker version 19.03.6, build 369ce74a3c

Python 3.6.9

openCV-python 4.1.1

Cuda release 10.2, V10.2.89

tensorRT 7.1.3.0

TensorFlow 2.5.0

Keras 2.5.0

#SNIPETS

/usr/local/cuda-10.2/bin/nvcc

export PATH=”$PATH:/usr/local/cuda-10.2/bin”

cat /usr/include/cudnn_version.h | grep CUDNN_MAJOR -A 2

apt search jetpack

 

nvidia-jetpack/stable,now 4.5.1-b17 arm64 [installed]

openCV 4.1.1

 

Verificar o software instalado.

Ubuntu 18.04.5 LTS (Bionic Beaver)

nvidia-jetpack v 4.5.1-b129

Docker version 19.03.6, build 369ce74a3c

Python 3.6.9

openCV-python 4.1.1

Cuda release 10.2, V10.2.89

tensorRT 7.1.3.0

 

Software instalado

ROS Melodic (http://wiki.ros.org/melodic/Installation/Ubuntu)

Official TensorFlow for Jetson Nano!

https://forums.developer.nvidia.com/t/official-tensorflow-for-jetson-nano/71770

Python 3.6+JetPack4.5

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
sudo pip3 install -U pip testresources setuptools==49.6.0
sudo pip3 install -U numpy==1.16.1 future==0.18.2 mock==3.0.5 h5py==2.10.0 keras_preprocessing==1.1.1 keras_applications==1.0.8 gast==0.2.2 futures protobuf pybind11
# TF-2.x
sudo pip3 install –pre –extra-index-url https://developer.download.nvidia.com/compute/redist/jp/v45 tensorflow
# TF-1.15
$ sudo pip3 install –pre –extra-index-url https://developer.download.nvidia.com/compute/redist/jp/v45 ‘tensorflow<2’

# error

sudo pip3 uninstall h5py==2.10.0

 

code snipets

import tensorrt as tf; print(tf.__version__)

sudo apt-cache show nvidia-jetpack