TensorFlow-gpu installation in Xavier

I was trying to install tensorflow-gpu. My preinstalled jetpack version is 4.2 so the corresponding CUDA is 10.2. I was trying to find the right tensorflow version for CUDA 10.2, so I found the following table:

Therefore, I tried this command:

sudo pip3 install --extra-index-url https://developer.download.nvidia.com/compute/redist/jp/v42 tensorflow-gpu==1.15.0+nv19.11

I got the following error message:
WARNING: The directory ‘/home/dewei/.cache/pip’ or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you may want sudo’s -H flag.
Looking in indexes: Simple index, https://developer.download.nvidia.com/compute/redist/jp/v42
Collecting tensorflow-gpu==1.15.0+nv19.11
Downloading https://developer.download.nvidia.com/compute/redist/jp/v42/tensorflow-gpu/tensorflow_gpu-1.15.0%2Bnv19.11-cp36-cp36m-linux_aarch64.whl (228.1 MB)
|████████████████████████████████| 228.1 MB 10.7 MB/s
WARNING: Discarding https://developer.download.nvidia.com/compute/redist/jp/v42/tensorflow-gpu/tensorflow_gpu-1.15.0%2Bnv19.11-cp36-cp36m-linux_aarch64.whl (from https://developer.download.nvidia.com/compute/redist/jp/v42/tensorflow-gpu/). Requested tensorflow-gpu==1.15.0+nv19.11 from https://developer.download.nvidia.com/compute/redist/jp/v42/tensorflow-gpu/tensorflow_gpu-1.15.0%2Bnv19.11-cp36-cp36m-linux_aarch64.whl has inconsistent version: filename has ‘1.15.0+nv19.11’, but metadata has ‘1.15.0+nv19.11.tf1’
ERROR: Could not find a version that satisfies the requirement tensorflow-gpu==1.15.0+nv19.11
ERROR: No matching distribution found for tensorflow-gpu==1.15.0+nv19.11

I also found this post here and it looks like only tensorflow-gpu 1.14.0 is avaiable with Jetpack 4.2 but it’s compatiable with CUDA 10.0 only, not 10.2.

I try to avoid upgrading Jetpack itself. Is there any way to install the compatible tensorflow with Jetpack4.2 and CUDA 10.2?

Hi,

We can download the tensorflow_gpu-1.15.0%2Bnv19.11-cp36-cp36m-linux_aarch64.whl with below command:
Could you give it a try?

$ sudo pip3 install --extra-index-url https://developer.download.nvidia.com/compute/redist/jp/v42 'tensorflow-gpu<2'

Thanks.

Hi,

This command ran successfully. Then I ran pip list, and found the following pkgs related and they are still 1.14.0:

tensorboard                   1.14.0
tensorflow-estimator          1.14.0
tensorflow-gpu                1.14.0+nv19.10

I got the followings after I import tensorflow as tf:
>>> import tensorflow
2021-03-03 23:25:35.704127: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Could not dlopen library ‘libcudart.so.10.0’; dlerror: libcudart.so.10.0: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /usr/local/cuda-10.2/lib64:
2021-03-03 23:25:35.704415: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Could not dlopen library ‘libcudart.so.10.0’; dlerror: libcudart.so.10.0: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /usr/local/cuda-10.2/lib64:
Segmentation fault (core dumped)

Hi,

Please noted that we stop to provide python2.7 package for a while.
The command will install a python3.6 package.

So you should check it with pip3 list.
And also import the library with the python3.

Thanks.