Windows10上Miniconda 4.8.3快速安装Pytorch 1.6.0及导入torch错误解决办法

开始

coda安装

Win 10安装Miniconda 4.8.3并配置镜像的看这个传送
Pytorch选择看这个传送
我这里演示使用VirtualBox里的win 10,配置上没有分给他独显。。因此没得cuda,因此复制下面的语句即可。
在这里插入图片描述

conda install pytorch torchvision cpuonly -c pytorch

在这里插入图片描述
这个语句我允许了两次。。。。所以上面显示已安装,但尴尬的来了

coda测试失败

在这里插入图片描述
这???我已经用coda安装过了,也重启尝试过还是酱紫。。。

pip安装

pip install torch==1.6.0+cpu torchvision==0.7.0+cpu -f https://download.pytorch.org/whl/torch_stable.html

在这里插入图片描述

测试报错

在这里插入图片描述
VS code中没有显示怎么办,在conda Prompt中运行终于发现了原因,C++的某个ese没有下载,根据提示到对应网站下载

succeed

在这里插入图片描述
到所给出的网站下载好安装之后测试ok

from __future__ import print_function
import torch
x = torch.empty(5, 3)
print(x)

运行结果
在这里插入图片描述

新问题

当我在vs code中run的时候
在这里插入图片描述

于是按照网上的帖子装numpy、mat、mat
结果还是一样error

参考

猜你喜欢

转载自blog.csdn.net/weixin_43031092/article/details/108745279
今日推荐