当前位置:网站首页>Jetson Nano 安装TensorFlow GPU及问题解决
Jetson Nano 安装TensorFlow GPU及问题解决
2022-07-01 08:47:00 【图灵。】
**
Jetson Nano 安装TensorFlow GPU及问题解决
**
1.安装pip3及更改源安装
nano 自带python3.6.9
sudo apt install python3-pip python3-dev
下载后若想更新pip3的版本,临时使用清华源
python3 -m pip install --upgrade pip -i https://pypi.tuna.tsinghua.edu.cn/simple
2.安装依赖及其它学习包
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已经自带cuda,只需在.bashrc文件中添加如下
export PATH=/usr/local/cuda/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH
终端输入nvcc -V查看版本。
Cuda compilation tools, release 10.2, V10.2.89
(2)安装各种依赖
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)安装TensorFlow GPU版本
方法一:
使用pip3安装TensorFlow,该命令将安装与JetPack 4.4兼容的TensorFlow的最新版本(博主使用该命令成功安装TensorFlow2.3.0,安装过程很漫长,你的JetPack版本若是4.5则将v44改为v45即可):
sudo pip3 install --pre --extra-index-url https://developer.download.nvidia.com/compute/redist/jp/v44 tensorflow
TensorFlow版本2是最近发布的,并且与TensorFlow 1.x并不完全向后兼容。如果您希望使用TensorFlow 1.x软件包,则可以通过将TensorFlow版本指定为小于2来安装它,如以下命令所示:
sudo pip3 install --pre --extra-index-url https://developer.download.nvidia.com/compute/redist/jp/v44 'tensorflow<2'
方法二:
还可以去官网挑选更多版本下载:
下载对应版本的.whl文件然后使用pip命令安装例如:官网
pip3 install tensorflow-1.15.5+nv22.3-cp38-cp38-linux_aarch64.whl
方法三:
参考官网给的安装方法https://docs.nvidia.com/deeplearning/frameworks/install-tf-jetson-platform/index.html
3.测试
终端一次输入
python3
import tensorflow as tf
# 输出提示:
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)
# 输出结果:
# tf.Tensor(3.0, shape=(), dtype=float32)
print('GPU:', tf.test.is_gpu_available())
# 输出最后一句为:
# GPU: True
4.问题及解决
(1)python版本低
遇到此问题则使用上述的方法二安装,并将下载的.whl文件中的两处protobuf>=3.6.1改为protobuf==3.6.1(你也可以将升级python,我认为升级python有点费劲)

(2)
执行此命令
python3 -m pip install --upgrade --force pip
pip3 install setuptools==33.1.1
边栏推荐
猜你喜欢

Model and view of QT

嵌入式工程师面试题3-硬件

动态代理
![Matlab [functions and images]](/img/8a/d2f68b5a7ed396ad20234c0aa24953.jpg)
Matlab [functions and images]

FreeRTOS学习简易笔记
V79.01 Hongmeng kernel source code analysis (user mode locking) | how to use the fast lock futex (Part 1) | hundreds of blogs analyze the openharmony source code

分享2022上半年我读过的7本书

MATLAB【函数和图像】

明明设计的是高带宽,差点加工成开路?

《单片机原理与应用》——并行IO口原理
随机推荐
I would like to know the process of stock registration and account opening by mobile phone? In addition, is it safe to open a mobile account?
如何高效拉齐团队认知
《微机原理》-绪论
Shell脚本-read命令:读取从键盘输入的数据
Centos7 shell脚本一键安装jdk、mongo、kafka、ftp、postgresql、postgis、pgrouting
IT 技术电子书 收藏
Software Engineer Interview Question brushing website and experience method
Shell脚本-while循环详解
Shell脚本-echo命令 转义符
Audio audiorecord create (I)
Glitch Free时钟切换技术
Li Kou 1358 -- number of substrings containing all three characters (double pointer)
爬虫知识点总结
Yolov3, 4, 5 and 6 Summary of target detection
Jeecg restart alarm 40001
View drawing process analysis
Shell脚本-变量的定义、赋值和删除
我想知道手机注册股票开户的流程?另外,手机开户安全么?
How can enterprises and developers take the lead in the outbreak of cloud native landing?
Guidelines and principles of did