当前位置:网站首页>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
边栏推荐
- Performance improvement 2-3 times! The second generation Kunlun core server of Baidu AI Cloud was launched
- What is the material of 15CrMoR, mechanical properties and chemical analysis of 15CrMoR
- Installing Oracle EE
- Guidelines and principles of did
- Matlab [functions and images]
- 基础:2.图像的本质
- What is the material of 16MnDR, the minimum service temperature of 16MnDR, and the chemical composition of 16MnDR
- Serial port to WiFi module communication
- Embedded Engineer Interview frequently asked questions
- MySQL8.0学习记录17 -Create Table
猜你喜欢

Share 7 books I read in the first half of 2022

电脑小技巧

【MFC开发(16)】树形控件Tree Control

Nacos - 配置管理

MATLAB【函数和图像】

Embedded Engineer Interview Question 3 Hardware

5mo3 UHI HII HII 17mn4 19Mn6 executive standard

《单片机原理及应用》-片外拓展

Principle and application of single chip microcomputer - off chip development

分享2022上半年我读过的7本书
随机推荐
Properties of 15MnNiNbDR low temperature vessel steel, Wugang 15MnNiDR and 15MnNiNbDR steel plates
Introduction to R language
基础:3.opencv快速入门图像和视频
猿人学第20题(题目会不定时更新)
Principle and application of single chip microcomputer - principle of parallel IO port
Embedded Engineer Interview Question 3 Hardware
Shell脚本-read命令:读取从键盘输入的数据
factory type_id::create过程解析
任务、线程、进程 区别
Qt的模型与视图
中考体育项目满分标准(深圳、安徽、湖北)
AVL树的理解和实现
In depth learning training sample amplification and tag name modification
What is the material of 16mo3 steel plate? What is the difference between 16mo3 and Q345R?
C语言指针的进阶(下)
Computer tips
软件工程师面试刷题网站、经验方法
Shell脚本-for循环和for int循环
C语言学生信息管理系统
【MFC开发(17)】高级列表控件List Control