Jetson Xavier NX安装jetpack,miniforge,tensorflow,jtop

系统烧录及设置SSD为启动盘

注意:建议按照视屏中采用在ubuntu18.04烧录系统,若使用20.04有一些指令更新,会导致系统烧录失败,系统烧录需要预留出大约2倍所提示的需要空间

参考视屏安装即可,资料位于网盘

链接:https://pan.baidu.com/s/16Zh8RYSIEjg_VSD7tlbI7A?pwd=0406

提取码:0406

遇到的问题

在这里插入图片描述

解决方法:将Automatic setup改为Manual setup,并将OEM configuration改为Runtime
在这里插入图片描述

注意:图中的第8项,应该设置为EMMC/SD Card,设置为NVMe表示安装到SSD,一般需要先将 镜像安装到EMMC或者SD Card,然后在将系统移动到SSD,具体操作见第四条视频。

深度学习开发环境

jetpack

可以直接安装jetpack,其中包含了cudacudnntensorrt

# 更新软件源 
sudo apt update 
# 安装JetPack组件包,其中包括了Cuda、CuDNN和TensorRT 
sudo apt install nvidia-jetpack

配置cuda环境变量,在~/.bashrc中添加以下内容

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

注意需要按照自己实际安装的版本添加内容,cuda版本可以通过以下指令查看

cd /usr/local/ 
ls 

查看jetpack版本

sudo apt-cache show nvidia-jetpack

miniforge

anaconda在jetson上不能使用,可以下载替代品miniforge

github下载地址:Release Release 23.1.0-1 · conda-forge/miniforge · GitHub
在这里插入图片描述

下载时要注意选择带有aarch后缀的文件。

下载完成后打开文件所在位置,通过sh指令安装

sh Miniforge-pypy3-23.1.0-1-Linux-aarch64.sh

使用方法同anaconda

遇到报错

CondaHTTPError:An HTTP error occurred when trying to retrieve this URL.
原因:下载源的问题,换成国内源就好了

解决办法:修改~/.condarc文件如下,换成国内源

channels:
  - defaults
show_channel_urls: true
channel_alias: https://mirrors.tuna.tsinghua.edu.cn/anaconda
default_channels:
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/pro
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2
custom_channels:
  conda-forge: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  msys2: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  bioconda: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  menpo: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  pytorch: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  simpleitk: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud

jtop工具

在终端输入以下指令

sudo apt-get install git cmake
sudo apt-get install python3-dev
sudo apt-get install libhdf5-serial-dev hdf5-tools
sudo apt-get install libatlas-base-dev gfortran
sudo apt-get install python3-pip
sudo -H pip3 install jetson-stats

安装完成后,启动jtop

sudo jtop

在这里插入图片描述

tensorflow

安装时需要注意tensorflow的版本要与jetpack版本对应,具体对应关系见官方文档:

TensorFlow For Jetson Platform - NVIDIA Docs
在这里插入图片描述

官方安装教程网址:Installing TensorFlow for Jetson Platform - NVIDIA Docs

安装依赖
# 安装tensorflow所需系统包
sudo apt-get update
sudo apt-get install libhdf5-serial-dev hdf5-tools libhdf5-dev zlib1g-dev zip libjpeg8-dev liblapack-dev libblas-dev gfortran
# 安装升级pip3
sudo apt-get install python3-pip
sudo python3 -m pip install --upgrade pip
sudo pip3 install -U testresources setuptools==65.5.0
# 安装python包依赖项
sudo pip3 install -U numpy==1.22 future==0.18.2 mock==3.0.5 keras_preprocessing==1.1.2 keras_applications==1.0.8 gast==0.4.0 protobuf pybind11 cython pkgconfig packaging h5py==3.6.0
安装TensorFlow

下面这个命令安装的是与 JetPack 5.1 兼容的最新版本的 TensorFlow2.11.0

sudo pip3 install --extra-index-url https://developer.download.nvidia.com/compute/redist/jp/v51 tensorflow==2.11.0+nv23.01

安装以前版本

sudo pip3 install --extra-index-url https://developer.download.nvidia.com/compute/redist/jp/v$JP_VERSION tensorflow==$TF_VERSION+nv$NV_VERSION

参数解释:
JP_VERSION

JetPack的版本,例如为v5.0.2时,这里为502

TF_VERSION

TensorFlow 的已发布版本,例如JetPack5.0.2对应的版本有2.9.1,2.10.0,2.10.1,这里选择2.9.1

NV_VERSION

NVIDIA Tensorflow Container的版本,对应的有22.07和22.09,这里选择22.07

则最终安装的指令为

sudo pip3 install --extra-index-url https://developer.download.nvidia.com/compute/redist/jp/v502 tensorflow==2.9.1+nv22.07 
pip报错

安装时遇到pip的警告,发现在环境中并没有安装好tensorflow

WARNING: Running pip as the ‘root’ user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

解决办法:安装tensorflow时,将指令前面的sudo去掉。

  • 4
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值