当前位置:网站首页>Pytorch installation new pit
Pytorch installation new pit
2022-07-27 05:34:00 【Tensor…Flow】
The problem background
It has been less than half a year since I went into the pit to study deeply ( Vegetable dog, a big man, don't laugh ),pytorch Become an integral part of me , Just install pytorch It won't go down 20 Time , A new server recently , The first step must be to match the environment step by step , Then you can run some experiments , little does one think pytorch It's cheating again .
Problems and Analysis
The problem is very simple , Server cuda Something has been installed , Just follow cuda Version to pytoch Just find the download order on the official website , Enter the command :
nvidia-smi

according to cuda Version find the latest installation command
conda install pytorch torchvision torchaudio cudatoolkit=11.3 -c pytorch
The first problem begins to appear , This is gone 2min Download progress of :
But we don't panic , Change the source , I found Qinghuayuan on the Internet 、 China University of science and technology , Put the path of the image in /home/ Own user name /.condarc below , Then according to the instructions of the online brother, remove the... In the download order -c pytorch( In this way, the order can be found in the country ):
conda install pytorch torchvision torchaudio cudatoolkit=11.3
As a general rule , It's over without any problem here , As a result, there is a second problem , The reason for the error is that the corresponding version cannot be found in several domestic sources torchaudio:
Then I began to try pip Download the corresponding version , I can't find it , There is no alternative but to continue conda Next try , Since this package cannot be found in these domestic sources , Then download it separately with the original command :
conda install torchaudio==0.10.1 -c pytorch
It turned out to be wrong , But this error report also gave me key information :
Actually quite surprised ,python Now it's all 3.10 了 , I can only blame myself for my ignorance , Honestly downgrade , Then rerun the command just now :
conda install torchaudio==0.10.1 -c pytorch
I feel that I can basically solve the problem here , Then I saw 
It seems that the initial problem has not been solved yet , Turn around and return to the origin , The domestic source cannot find the corresponding package , The source of the official website is too slow and often disconnected , Just when I was stuck in a bottleneck , My classmate told me that it was no problem for him to change the source in the same way on the original server ! It occurred to me that : No, people's domestic sources are different from mine ?!
No, I don't know , I was surprised to find it :
Sure enough, it's still the trouble caused by the lack of knowledge , Thanks to Beiwai mirror source ! Directly in their own .condarc Add these two sentences :
-https://mirrors.bfsu.edu.cn/anaconda/pkgs/main/
-https://mirrors.bfsu.edu.cn/anaconda/pkgs/free/
Then it's back to the order just now :
conda install pytorch torchvision torchaudio cudatoolkit=11.3
Check regularly after installation pytorch Is the installation successful , Get into python Environmental Science :
$ >> import torch
$ >> torch.cuda.is_available()
True
End of the flower !!
边栏推荐
猜你喜欢

Simplify the mybits framework of JDBC

Looking at the PK of alphago and Li Shishi from a deep perspective

pytorch 数据类型 和 numpy 数据 相互转化

C语言初阶——分支语句(if,switch)

小米商城项目_注册

JVM part I: memory and garbage collection part II -- class loading subsystem

Li Hongyi machine learning team learning punch in activity day05 --- skills of network design

redis集群

Differences among bio, NiO and AIO

pytorch安装新坑
随机推荐
异步数据-短信验证码
Pinball games
如何查看导师的评价
分享力扣—189.轮转数组 的三种解法
redis事务
Li Hongyi machine learning team learning punch in activity day01 --- introduction to machine learning
后台订单管理
【codeforces 1695C Zero Path】DP
Carmaker quick start lesson 4 developing 48V P1 hybrid system
Li Hongyi machine learning team learning punch in activity day03 --- error and gradient decline
2021 Niuke multi school training camp 5 (question b)
Seckill system design
秒杀系统设计
Student management system
Niuke sword refers to the path in the offer--jz12 matrix
The receiver sets the concurrency and current limit
初识C语言——常量、变量
Li Hongyi machine learning team learning punch in activity day02 --- return
GCC 编译选项
封装JWT