2019년 9월 27일 금요일

JetsonNano - Installing Tensorflow

Tensorflow latest version install

last updated 2021.03.23 : update for Jetpack 4.5(Production Release)

I used Jetson Nano, Ubuntu 18.04 Official image with root account.

First, check the version of JetPack you are using. Then, refer to the part  that corresponds to your JetPack and install the necessary packages. In the middle of the site name where you can download tensorflow for Jetson, v42, v43, v44, v45 tells you the version of JetPack.

JetPack 4.2 Users

 First check the latest version at  https://developer.download.nvidia.com/compute/redist/jp/v42/tensorflow-gpu/  . In the url, v42 means Jetpack version 4.2.
At this point(2020.04), there are 8 whl files .
The cp36 in the filename means python version 3.6. I'm going to install the latest Tensorflow 1.X version. You can use "tensorflow_gpu-1.15.0+nv19.11-cp36-cp36m-linux_aarch64.whl" file.

Install required packages first. This takes some time for jetson Nano, so take a coffee time.


apt-get install -y python3-pip
apt-get install -y libhdf5-serial-dev hdf5-tools libhdf5-dev zlib1g-dev zip libjpeg8-dev
#if you install tensorflow 1.14 
pip3 install -U numpy==1.16.5 grpcio absl-py py-cpuinfo psutil portpicker six mock requests gast h5py astor termcolor protobuf keras-applications keras-preprocessing wrapt google-pasta
 
#if you install tensorflow 1.15 
pip3 install -U numpy grpcio absl-py py-cpuinfo psutil portpicker six mock requests gast h5py astor termcolor protobuf keras-applications keras-preprocessing wrapt google-pasta

Now install the tensorflow.
If you want to install Tensorflow 1.14, execute the following command.

pip3 install  https://developer.download.nvidia.com/compute/redist/jp/v42/tensorflow-gpu/tensorflow_gpu-1.14.0+nv19.7-cp36-cp36m-linux_aarch64.whl

If you want to install Tensorflow 1.15, execute the following command.

pip3 install  https://developer.download.nvidia.com/compute/redist/jp/v42/tensorflow-gpu/tensorflow_gpu-1.15.0+nv19.11-cp36-cp36m-linux_aarch64.whl

JetPack 4.3 Users

 First check the latest version at  https://developer.download.nvidia.com/compute/redist/jp/v43/tensorflow-gpu/ . In the url, v43 means Jetpack version 4.3. At this point(2020.04), there are 4 whl files
 
The cp36 in the filename means python version 3.6.

I'm going to install the latest Tensorflow 1.X version. You can use "tensorflow_gpu-1.15.0+nv20.1-cp36-cp36m-linux_aarch64.whl" file.

Install required packages first. This takes some time for jetson Nano, so take a coffee time.


apt-get install -y python3-pip
apt-get install -y libhdf5-serial-dev hdf5-tools libhdf5-dev zlib1g-dev zip libjpeg8-dev
pip3 install -U numpy grpcio absl-py py-cpuinfo psutil portpicker six mock requests gast h5py astor termcolor protobuf keras-applications keras-preprocessing wrapt google-pasta


Now install the tensorflow.
If you want to install Tensorflow 1.15, execute the following command.

pip3 install  https://developer.download.nvidia.com/compute/redist/jp/v43/tensorflow-gpu/tensorflow_gpu-1.15.0+nv20.1-cp36-cp36m-linux_aarch64.whl

JetPack 4.4 Users

 First check the latest version at https://developer.download.nvidia.com/compute/redist/jp/v44/tensorflow/. The March 2021 version(nv20.12) is TensorFlow for the JetPack 4.4 Production Release version.

  • tensorflow-1.15.2+nv20.4-cp36-cp36m-linux_aarch64.whl 222MB 2020-04-30 07:01:03
  • tensorflow-1.15.2+nv20.6-cp36-cp36m-linux_aarch64.whl 232MB 2020-07-07 08:58:21
  • tensorflow-2.1.0+nv20.4-cp36-cp36m-linux_aarch64.whl 231MB 2020-08-05 18:51:59
  • tensorflow-2.2.0+nv20.6-cp36-cp36m-linux_aarch64.whl 276MB 2020-07-07 08:58:31
  • tensorflow-1.15.3+nv20.7-cp36-cp36m-linux_aarch64.whl 227MB 2020-08-05 01:39:24
  • tensorflow-2.2.0+nv20.7-cp36-cp36m-linux_aarch64.whl 274MB 2020-08-05 01:39:36
  • tensorflow-1.15.3+nv20.8-cp36-cp36m-linux_aarch64.whl 227MB 2020-09-02 07:31:18
  • tensorflow-2.2.0+nv20.8-cp36-cp36m-linux_aarch64.whl 276MB 2020-09-02 07:31:28
  • tensorflow-1.15.3+nv20.9-cp36-cp36m-linux_aarch64.whl 217MB 2020-10-05 20:25:07
  • tensorflow-2.3.0+nv20.9-cp36-cp36m-linux_aarch64.whl 264MB 2020-10-05 20:24:40
  • tensorflow-1.15.4+nv20.10-cp36-cp36m-linux_aarch64.whl 217MB 2020-10-24 00:51:44
  • tensorflow-2.3.1+nv20.10-cp36-cp36m-linux_aarch64.whl 264MB 2020-10-24 00:51:52
  • tensorflow-1.15.4+nv20.11-cp36-cp36m-linux_aarch64.whl 218MB 2020-11-24 19:01:32
  • tensorflow-2.3.1+nv20.11-cp36-cp36m-linux_aarch64.whl 264MB 2020-11-24 19:01:35
  • tensorflow-1.15.4+nv20.12-cp36-cp36m-linux_aarch64.whl 218MB 2020-12-18 14:54:04
  • tensorflow-2.3.1+nv20.12-cp36-cp36m-linux_aarch64.whl 264MB 2020-12-18 14:54:06

I'm going to install the latest Tensorflow 1.X version. You can use "tensorflow-1.15.4+nv20.12-cp36-cp36m-linux_aarch64.whl" file.

Install required packages first. This takes some time for jetson Nano, so take a coffee time.


apt-get install -y python3-pip
apt-get install -y libhdf5-serial-dev hdf5-tools libhdf5-dev zlib1g-dev zip libjpeg8-dev
pip3 install -U numpy grpcio absl-py py-cpuinfo psutil portpicker six mock requests gast h5py astor termcolor protobuf keras-applications keras-preprocessing wrapt google-pasta

Now install the tensorflow.
If you want to install Tensorflow 1.15, execute the following command.


pip3 install  https://developer.download.nvidia.com/compute/redist/jp/v44/tensorflow/tensorflow-1.15.4+nv20.12-cp36-cp36m-linux_aarch64.whl

JetPack 4.5 Users

 First check the latest version at https://developer.download.nvidia.com/compute/redist/jp/v45/tensorflow/
At this point(2021.03), there are 6 whl files
Now install the tensorflow.
If you want to install Tensorflow 1.15.5, execute the following command.

You may encounter such errors when installing the packages.


fatal error: xlocale.h: No such file or directory
    #include <xlocale.h>

The workaround  is so simple, just link the missing file with a symbolic link:


apt-get install -y python3-pip python3-numpy 
pip3 install --upgrade cython
ln -s /usr/include/locale.h /usr/include/xlocale.h
apt-get install -y libhdf5-serial-dev hdf5-tools libhdf5-dev zlib1g-dev zip libjpeg8-dev
pip3 install grpcio absl-py py-cpuinfo psutil portpicker six mock requests gast h5py astor termcolor protobuf keras-applications keras-preprocessing wrapt google-pasta
pip3 install https://developer.download.nvidia.com/compute/redist/jp/v45/tensorflow/tensorflow-1.15.5+nv21.3-cp36-cp36m-linux_aarch64.whl

Check

You can run python3 and import tensorflow to check if TensorFlow is installed properly.

1
2
3
python3
>>import tensorflow as tf
>>tf.test.is_gpu_available()

댓글 없음:

댓글 쓰기