当前位置:网站首页>Jetson nano installs tensorflow GPU and problem solving

Jetson nano installs tensorflow GPU and problem solving

2022-07-01 08:50:00 Turing.

**

Jetson Nano install TensorFlow GPU And problem solving

**
1. install pip3 And change the source installation
nano Bring their own python3.6.9

sudo apt install python3-pip python3-dev

If you want to update after downloading pip3 Version of , Temporarily use Tsinghua source

python3 -m pip install --upgrade pip -i https://pypi.tuna.tsinghua.edu.cn/simple

2. Install dependencies and other learning packages

sudo apt install python3-scipy -y
sudo apt install python3-pandas -y
sudo apt install python3-sklearn -y
sudo apt install python3-seaborn -y

(1)nano Already brought cuda, Just in .bashrc Add the following to the file

export PATH=/usr/local/cuda/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH

The input terminal nvcc -V View version .
Cuda compilation tools, release 10.2, V10.2.89
(2) Install various dependencies

sudo apt-get update
sudo apt install libhdf5-serial-dev hdf5-tools libhdf5-dev zlib1g-dev zip libjpeg8-dev liblapack-dev libblas-dev gfortran
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

(3) install TensorFlow GPU edition
Method 1 :
Use pip3 install TensorFlow, This command will install and JetPack 4.4 Compatible TensorFlow Latest version ( Bloggers use this command to successfully install TensorFlow2.3.0, The installation process is long , Yours JetPack Version if 4.5 Will v44 Change it to v45 that will do ):

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

TensorFlow edition 2 It's recently released , And with TensorFlow 1.x Not fully backward compatible . If you want to use TensorFlow 1.x software package , You can do this by TensorFlow The version is specified as less than 2 To install it , As the following command shows :

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

Method 2 :
You can also go to the official website to select more versions to download :
Download the corresponding version of .whl File and then use pip Command installation, such as : Official website
 Insert picture description here

pip3 install tensorflow-1.15.5+nv22.3-cp38-cp38-linux_aarch64.whl

Method 3 :
Refer to the installation method given on the official website https://docs.nvidia.com/deeplearning/frameworks/install-tf-jetson-platform/index.html
3. test
One time input of terminal

python3
import tensorflow as tf
#  Output hint :
tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcudart.so.10.2

a = tf.constant(1.)
b = tf.constant(2.)
print(a+b)
#  Output results :
# tf.Tensor(3.0, shape=(), dtype=float32)
 
print('GPU:', tf.test.is_gpu_available())
#  Output the last sentence as :
# GPU: True

4. Problems and Solutions
(1)python Version low
 Insert picture description here
If you encounter this problem, use the above method 2 to install , And will download .whl Two places in the file protobuf>=3.6.1 Change it to protobuf==3.6.1( You can also upgrade python, I think upgrading python A little bit difficult )
 Insert picture description here
 Insert picture description here
(2)
 Insert picture description here
Execute this command

python3 -m pip install --upgrade --force pip
pip3 install setuptools==33.1.1
原网站

版权声明
本文为[Turing.]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/182/202207010847028311.html