当前位置: 首页 > news >正文

【jeston】torch相关环境安装

参考:玩转NVIDIA Jetson (25)— jetson 安装pytorch和torchvision

我的jeston信息:
请添加图片描述

torch install

安装环境

conda create -n your_env python=3.8
conda activate your_env

pytorch_for_jeston

安装.whl文件

验证:

import torch
print(torch.__version__)

import torch报错ImportError: libopenblas.so.0: cannot open shared object file: No such file or directo


NVIDIA Jetson NX安装torchvision教程

sudo apt-get install libjpeg-dev zlib1g-dev libpython3-dev libavcodec-dev libavformat-dev libswscale-dev

https://github.com/pytorch/vision

git clone --branch  v0.13.0 https://github.com/pytorch/vision/torchvision

torchvision install

选择对应版本:
在这里插入图片描述

离线下载网址:torchvision离线包

pip install  xxxx.whl

验证:

import torchvision
print(torchvision.__version__)>>> print(torchvision.__version__)
0.13.0

出现警告:

import torchvision
/home/nvidia/.conda/envs/env_name/lib/python3.8/site-packages/torchvision/io/image.py:13: UserWarning: Failed to load image Python extension:
warn(f"Failed to load image Python extension: {e}")

try1:

pip install 'pillow<7'
# 不兼容
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
matplotlib 3.7.5 requires packaging>=20.0, which is not installed.pip uninstall matplotlib
pip install 'pillow<7'
(env_name) nvidia@nvidia-desktop:~/Downloads$ pip list
Package                 Version
----------------------- -----------------------
absl-py                 2.1.0
cachetools              5.5.0
certifi                 2024.8.30
charset-normalizer      3.3.2
contourpy               1.1.1
cycler                  0.12.1
filelock                3.16.1
fonttools               4.54.0
fsspec                  2024.9.0
google-auth             2.35.0
google-auth-oauthlib    1.0.0
grpcio                  1.66.1
idna                    3.10
importlib_metadata      8.5.0
importlib_resources     6.4.5
Jinja2                  3.1.4
joblib                  1.4.2
kiwisolver              1.4.7
loguru                  0.7.2
Markdown                3.7
MarkupSafe              2.1.5
mpmath                  1.3.0
networkx                3.1
numpy                   1.24.4
oauthlib                3.2.2
Pillow                  6.2.2
pip                     24.2
protobuf                5.28.2
ptflops                 0.7.3
pyasn1                  0.6.1
pyasn1_modules          0.4.1
pycairo                 1.26.1
PyGObject               3.48.2
pygst                   0.0.4
pyparsing               3.1.4
python-dateutil         2.9.0.post0
requests                2.32.3
requests-oauthlib       2.0.0
rsa                     4.9
scikit-learn            1.3.2
scipy                   1.10.1
setuptools              74.1.2
six                     1.16.0
sympy                   1.13.3
tensorboard             2.14.0
tensorboard-data-server 0.7.2
thop                    0.1.1.post2209072238
threadpoolctl           3.5.0
torch                   1.12.0a0+2c916ef.nv22.3
torchvision             0.13.0
traitlets               5.14.3
typing_extensions       4.12.2
urllib3                 2.2.3
Werkzeug                3.0.4
wheel                   0.44.0
zipp                    3.20.2
pip3 install torchvision==0.13.0Downloading torchvision-0.13.0-cp38-cp38-manylinux2014_aarch64.whl (701 kB)━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 701.7/701.7 kB 7.2 MB/s eta 0:00:00
Installing collected packages: torchvision
Successfully installed torchvision-0.13.0

try2

但是我的版本是对的,但是只是个警告 ignore it

import torch不出错,但是import torchvision报错:UserWarning: Failed to load image Python extension: Could not

Verification

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))

Build from Source

Note on Upgrading pip

http://www.lryc.cn/news/460807.html

相关文章:

  • [CR]厚云填补_大型卫星影像去云数据集
  • Langchain CharacterTextSplitter无法分割文档问题
  • ros service不走是为什么
  • 量子计算机的原理与物理实现
  • SQL Server 常用关键词语法汇总
  • 软件测试工程师面试整理 —— 操作系统与网络基础!
  • 网络安全防御策略:通过限制IP访问提升服务器安全性
  • Multiprocessing出错没有提示was skipped without notice in python
  • 调整应用窗口透明度
  • 启智畅想集装箱号码智能识别原理,OCR识别应用
  • React基础知识
  • Java基础:面向对象编程3
  • 实验kubernetes的CPU绑定策略
  • Zsh 安装与配置
  • Redis可视化工具Redis Desktop Manager(附安装包)
  • sql server删除过期备份文件脚本
  • 【Docker系列】Docker查看镜像架构
  • Python案例 | 测试网络的下载速度上传速度和 ping 延迟
  • 一键找回,2024四大固态硬盘数据恢复工具推荐!
  • 数据结构~AVL树
  • ffmpeg面向对象——rtsp拉流探索(1)
  • 【启明智显分享】ZX7981PM WIFI6 5G-CPE:2.5G WAN口,2.4G/5G双频段自动调速
  • openresty“热部署“lua
  • 基于SpringBoot+Vue+MySQL的企业招聘管理系统
  • vue3之defineComponent
  • springboot+vue家政服务管理平台
  • python pip安装requirements.txt依赖与国内镜像
  • 解决Qt的QWidget设计师编辑UI后和软件运行显示不一致
  • 交易所开发:构建安全、高效、可靠的数字资产交易平台
  • 【Next.js 入门教程系列】09-优化技巧