当前位置:网站首页>[problem] pytorch installation

[problem] pytorch installation

2022-07-07 22:27:00 Eva215665

install pytorch after , Error in importing module

import torch
import torchvision

the repository located at download.pytorch.org is not a trusted or secure host and is being ignored. If this repository is available via HTTPS we recommend you use HTTPS instead, otherwise you may silence this warning and allow it anyway with ‘–trusted-host download.pytorch.org’

Solution :

  1. Go to pytorch Official website : https://pytorch.org/get-started/locally/

  2. Choose your own environment , Here's the picture
     Insert picture description here

  3. The official website automatically gives the installation order :

pip install torch==1.6.0+cu101 torchvision==0.7.0+cu101 -f http://download.pytorch.org/whl/torch_stable.html
  1. stay anaconda prompt After executing the command in , Report errors :The repository located at pypi.doubanio.com is not a trusted or secure host and is being ignored. Pictured
     Insert picture description here
  2. So a lot of it is http Source , If used directly http That would make a mistake , Then what shall I do? ? After reading the above prompt, I will http Change it to https try
pip install torch==1.6.0+cu101 torchvision==0.7.0+cu101 -f https://download.pytorch.org/whl/torch_stable.html

Problem solving !
 Insert picture description here

原网站

版权声明
本文为[Eva215665]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202130605188054.html