在LInux/ubuntu上安装特定版本的 Pytorch ,例如 0.3.1版本

指令

conda install pytorch=0.3.1 torchvision cuda90 -c pytorch

注意事项:

1   pytorch=0.3.1  (0.3.1 改为你要安装的pytorch版本)  查看pytorch版本号点我

2   cuda90 改为你自己的cuda版本

 

在安装pytorch时有时候会报错,其中出现”CondaHTTPError: HTTP None None for url…..”这类错误时

基本是因为有些库需要外网才能下载,所以我们需要使用conda的清华镜像。

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --set show_channel_urls yes

然后再运行 

conda install pytorch=0.3.1 torchvision cuda90 -c pytorch

 

参考文章

Linux上用anaconda安装pytorch

 

 

加油  2018.10.1

(foundationpose) root@localhost:/mnt/e/wsl/foundationpose-main# nvidia-smi # 检查 GPU 驱动状态 --version # 检查 CUDA 版本 pip list | grep torch # 检查 PyTorch 版本Sun Jul 27 01:12:14 2025 +-----------------------------------------------------------------------------------------+ | NVIDIA-SMI 560.35.02 Driver Version: 560.94 CUDA Version: 12.6 | |-----------------------------------------+------------------------+----------------------+ | GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. | | | | MIG M. | |=========================================+========================+======================| | 0 NVIDIA GeForce RTX 2070 ... On | 00000000:26:00.0 On | N/A | | 33% 35C P8 12W / 215W | 1166MiB / 8192MiB | 0% Default | | | | N/A | +-----------------------------------------+------------------------+----------------------+ +-----------------------------------------------------------------------------------------+ | Processes: | | GPU GI CI PID Type Process name GPU Memory | | ID ID Usage | |=========================================================================================| | 0 N/A N/A 35 G /Xwayland N/A | +-----------------------------------------------------------------------------------------+ (foundationpose) root@localhost:/mnt/e/wsl/foundationpose-main# nvcc --version # 检查 CUDA 版本 nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2024 NVIDIA Corporation Built on Fri_Jun_14_16:34:21_PDT_2024 Cuda compilation tools, release 12.6, V12.6.20 Build cuda_12.6.r12.6/compiler.34431801_0 (foundationpose) root@localhost:/mnt/e/wsl/foundationpose-main# pip list | grep torch # 检查 PyTorch 版本 pytorch3d 0.7.3 torch 1.13.1 torch3d 0.1 torchaudio 0.13.1 torchnet 0.0.4 torchvision 0.14.1 (foundationpose) root@localhost:/mnt/e/wsl/foundationpose-main# import nvdiffrast.torch as dr .RasterizeCudaContext() # 应返回 <nvdiffrast.torch.RasterizeCudaContext>Command &#39;import&#39; not found, but can be installed with: apt install graphicsmagick-imagemagick-compat # version 1.4+really1.3.42-1, or apt install imagemagick-6.q16 # version 8:6.9.11.60+dfsg-1.6ubuntu1 apt install imagemagick-6.q16hdri # version 8:6.9.11.60+dfsg-1.6ubuntu1
最新发布
07-28
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值