赞
踩
首先使用root权限创建环境:
sudo -s
conda create-n 你的虚拟环境名 python=3.7
查询与自己安装的cuda对应的版本,由于直接在线安装较慢,有以下两种较快的方法:
强烈推荐方法二,亲测好用
1)方法一:可以先将torch-1.3.0和torchvision-0.4.1的.whl文件下载好,下载地址:
https://download.pytorch.org/whl/torch_stable.html
激活刚刚创建的环境,比如这里我的是:
source activate pytorch
进入环境后使用pip命令离线安装torch和torchvision:
a. 进入下载目录,并安装torch:
pip3 install torch-1.0.0-cp37-cp37m-linux_x86_64.whl
(pytorch) root@yy:~# cd '/home/yy/下载'
(pytorch) root@yy:~/下载# ls
Anaconda3-2020.02-Linux-x86_64.sh cudnn-10.0-linux-x64-v7.4.2.24.tgz
cuda torch-1.0.0-cp37-cp37m-linux_x86_64.whl
cuda_10.0.130_410.48_linux.run
(pytorch) root@yy:~/下载# pip3 install torch-1.0.0-cp37-cp37m-linux_x86_64.whl
WARNING: The directory '/home/yy/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Processing
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。