Pytorch安装不成功的解决-办法

前提: 配置清华源镜像
方法一:
复制Pytorch官网命令,并将 -c pytorch删除
-c pytorch是强制从PyTorch官网下载包,配置的清华源就会失效。

#conda install pytorch torchvision cudatoolkit=10.0 -c pytorch  官网源命令
conda install pytorch torchvision cudatoolkit=10.0   

方法二:

pip install torch===1.4.0+cu100 torchvision===0.5.0+cu100 -f https://download.pytorch.org/whl/torch_stable.html

方法三:(可以尝试)(版本自行选择)

pip install torch-1.4.0+cpu-cp36-cp36m-win_amd64.whl
pip install torchvision-0.5.0+cpu-cp36-cp36m-win_amd64.whl

Pytorch安装包地址:https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/linux-64/
输入命令:

conda install pytorch-1.4.0-py3.8_cuda10.0.130_cudnn7.6.3_0.tar.bz2
conda install torchvision-0.5.0-py37_cu101.tar.bz2

同理 缺啥补啥

查看版本:

torch.__version__
torchvision.__version__

你可能感兴趣的:(环境配置,ubuntu)