Miniconda 4.8.3 on Windows 10 quickly install Pytorch 1.6.0 and import torch error solutions

Start

coda installation

Win 10 installs Miniconda 4.8.3 and configures the mirror to see this transfer
Pytorch chooses to see this transfer.
Here I demonstrate the use of win 10 in VirtualBox, and there is no separate display for him in the configuration. . Therefore, there is no cuda, so just copy the following statement.
Insert picture description here

conda install pytorch torchvision cpuonly -c pytorch

Insert picture description here
I allowed this statement twice. . . . So the above display has been installed, but the embarrassment is coming

coda test failed

Insert picture description here
This? ? ? I have installed it with coda, and tried to restart it. . .

pip install

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

Insert picture description here

Test error

Insert picture description here
What should I do if there is no display in VS code? I finally found the reason after running in conda Prompt. A certain ese of C++ was not downloaded. Follow the prompts to download from the corresponding website

succeed

Insert picture description here
Go to the given website to download and install, test ok

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

operation result
Insert picture description here

New problem

When I run in vs code
Insert picture description here

So install numpy and mat according to online posts, the 、mat
result is still the same error

reference

Guess you like

Origin blog.csdn.net/weixin_43031092/article/details/108745279