您好,登錄后才能下訂單哦!
這篇文章主要介紹“Jetson NX配置pytorch的問(wèn)題如何解決”的相關(guān)知識(shí),小編通過(guò)實(shí)際案例向大家展示操作過(guò)程,操作方法簡(jiǎn)單快捷,實(shí)用性強(qiáng),希望這篇“Jetson NX配置pytorch的問(wèn)題如何解決”文章能幫助大家解決問(wèn)題。
環(huán)境情況: 系統(tǒng)JetPack 5.0.2 --ubuntu20.04 配置流程 安裝miniconda(流程省略)conda create -n pytorch python=3.8 安裝pytorch
sudo apt-get -y update;
sudo apt-get -y install autoconf bc build-essential g++-8 gcc-8 clang-8 lld-8 gettext-base gfortran-8 iputils-ping libbz2-dev libc++-dev libcgal-dev libffi-dev libfreetype6-dev libhdf5-dev libjpeg-dev liblzma-dev libncurses5-dev libncursesw5-dev libpng-dev libreadline-dev libssl-dev libsqlite3-dev libxml2-dev libxslt-dev locales moreutils openssl python-openssl rsync scons python3-pip libopenblas-dev;
sudo apt-get install python3-pip libopenblas-base libopenmpi-dev
conda activate pytorch
pip3 install Cython
export PATH=/usr/local/cuda/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH
export CUDA_ROOT=/usr/local/cuda
export TORCH_INSTALL=https://developer.download.nvidia.cn/compute/redist/jp/v51/pytorch/torch-1.14.0a0+44dac51c.nv23.02-cp38-cp38-linux_aarch74.whl
python3 -m pip install --upgrade pip; python3 -m pip install aiohttp numpy=='1.19.4' scipy=='1.5.3'; python3 -m pip install --upgrade protobuf; python3 -m pip install --no-cache $TORCH_INSTALL
torchvision pip install torchvision
>>> import torch >>> print(torch.__version__) >>> print('CUDA available: ' + str(torch.cuda.is_available())) >>> print('cuDNN version: ' + str(torch.backends.cudnn.version())) >>> a = torch.cuda.FloatTensor(2).zero_() >>> print('Tensor a = ' + str(a)) >>> b = torch.randn(2).cuda() >>> print('Tensor b = ' + str(b)) >>> c = a + b >>> print('Tensor c = ' + str(c)) >>> import torchvision >>> print(torchvision.__version__)
配合repvgg的部署 pip install opencv-contrib-python
pip install matplotlib
pip install torchvision
其他問(wèn)題
報(bào)錯(cuò):
ImportError: cannot import name ‘PILLOW_VERSION’ from ‘PIL’ (/home/jiajie/anaconda3/envs/py35/lib/python3.7/site-packages/PIL/init.py)
解決:pip index versions pillow
or conda search pillow
pip3 install pillow==6.2.0
警告:
UserWarning: Failed to load image Python extension:
warn(f"Failed to load image Python extension: {e}")
解決:
沒(méi)解決,據(jù)說(shuō)是pytorch版本太高,或者是pytorch與torchvision版本不契合
安裝pytorch 中第7步,不同版本的jetpack需要根據(jù)情況修改版本,
https://developer.download.nvidia.com/compute/redist/jp
選擇指定的版本以后復(fù)制網(wǎng)頁(yè)url后替換第7步
關(guān)于“Jetson NX配置pytorch的問(wèn)題如何解決”的內(nèi)容就介紹到這里了,感謝大家的閱讀。如果想了解更多行業(yè)相關(guān)的知識(shí),可以關(guān)注億速云行業(yè)資訊頻道,小編每天都會(huì)為大家更新不同的知識(shí)點(diǎn)。
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。