当前位置:网站首页>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
边栏推荐
- Yolov3, 4, 5 and 6 Summary of target detection
- MD文档中插入数学公式,Typora中插入数学公式
- TypeError: __init__() got an unexpected keyword argument ‘autocompletion‘
- Brief introduction to AES
- 用C语言编程:用公式计算:e≈1+1/1!+1/2! …+1/n!,精度为10-6
- 任务、线程、进程 区别
- C语言指针的进阶(下)
- 分享2022上半年我读过的7本书
- Share 7 books I read in the first half of 2022
- Introduction to R language
猜你喜欢
![[MFC development (17)] advanced list control list control](/img/e8/24c52cb51defc6c96b43c2ef3232ff.png)
[MFC development (17)] advanced list control list control

你了解数据是如何存储的吗?(C整型和浮点型两类)

Nacos - 服务发现

Principle and application of single chip microcomputer - principle of parallel IO port

How can enterprises and developers take the lead in the outbreak of cloud native landing?

《微机原理》—总线及其形成

Computer tips

截图小妙招

Advanced level of C language pointer (Part 1)

TypeError: __init__() got an unexpected keyword argument ‘autocompletion‘
随机推荐
LogBack
R语言观察日志(part24)--初始化设置
Memory size end
Introduction to 18mnmo4-5 steel plate executive standard and delivery status of 18mnmo4-5 steel plate, European standard steel plate 18mnmo4-5 fixed rolling
What is the material of 16MnDR, the minimum service temperature of 16MnDR, and the chemical composition of 16MnDR
中考体育项目满分标准(深圳、安徽、湖北)
长安链同步节点配置与启动
Advanced level of C language pointer (Part 1)
Share 7 books I read in the first half of 2022
vscode自定义各个区域的颜色
Nacos - 配置管理
毕业季,我想对你说
Shell脚本-位置参数(命令行参数)
Li Kou 1358 -- number of substrings containing all three characters (double pointer)
性能提升2-3倍!百度智能云第二代昆仑芯服务器上线
ARM v7的体系结构A、R、M区别,分别应用在什么领域?
中断与其他函数共享变量、临界资源的保护
我想知道手机注册股票开户的流程?另外,手机开户安全么?
如何做好固定资产管理?易点易动提供智能化方案
Introduction to R language