当前位置:网站首页>Get familiar with pytoch and pytoch environment configuration
Get familiar with pytoch and pytoch environment configuration
2022-07-24 18:18:00 【Kang|King】
First time to know Pytorch and Pytorch Environment configuration
pytorch Development and framework of
Deep learning framework , For me, it is divided into Tensorflow and Pytorch Two camps . The main difference between them is whether static graph takes precedence or dynamic graph takes precedence .
Dynamic graph static graph
Dynamic graph : Step by step , It has results and conforms to people's thinking .
Static diagram : Only the formula , Then finally input the data . This is a state of separation , Define the formula ,run When inputting data directly, it is used and cannot be modified , namely define→run The process of .
Performance comparison between the two

Tensorflow1 and 2 Incompatibility made me laugh ,1 The advantages of 2 Unable to inherit .
pytorch What can be done ?
pytorch Sure GPU Speed up , Automatic derivation , There are common network layers .
For example, do a GPU The acceleration of :
First use here Cuda Why longer ? Because some configurations need to be initialized , It takes time , The second time you can see that there is obviously less time .
For derivation , The code is as follows :
# assignment , tell torch I need derivation
x = torch.tensor(1.)
a = torch.tensor(1., requires_grad=True)
b = torch.tensor(2., requires_grad=True)
c = torch.tensor(3., requires_grad=True)
...
grads = autograd.grad(y, [a,b,c])
# It's been worked out a,b,c Are the corresponding derivatives
Common network layer :nn.Linear nn.Conv2d nn.LSTM And some activation functions “ function ”.
Environment configuration
Because I just changed Y9000P, And is 32G Memory +512G+1T Solid state of , So I'm not afraid of anything !(bushi)
My configuration idea is Anaconda Build on .
- install Anaconda(python It will also be installed incidentally , What needs to be noticed inside is path Adding options must be important !!!)
- Find the corresponding version of your graphics card , Because my driver has been installed , So I don't need to go to the official website to install or update , If necessary , The first Cuda Install well .
- install Cudnn
- stay Anaconda Of Prompt Create a file named Pytorch Environment
- stay Pytorch Find the corresponding version on the official website , It's activated Pytorch After the environment , Run the corresponding statement ( Because after you choose the version on the official website , There will be corresponding running statements , Copy to the command line )
- I choose jupyter notebook To operate , Enter jupyter notebook You can jump to the corresponding interface .
Problems encountered
How to check your own graphics card version / How to see yourself CUDA edition ?
Solution : open nvidia panel , Help includes .
WARNING conda.gateways.disk.delete:unlink_or_rename_to_trash(140)
Solution :csdn
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solution : It may be that the corresponding limit time is too short ; Change to Tsinghua source ; Download the package directly , Offline local installation .( Or you even Cudnn Not even loaded )
边栏推荐
猜你喜欢

【刷题记录】20. 有效的括号

redis集群的三种方式

初识Pytorch和Pytorch环境配置

Bib | mol2context vec: context aware deep network model learning molecular representation for drug discovery

0630~职业素养课

0625~<config>-<bus>

0630~ professional quality course

About the writing method of interface 1 chain interpretation 2. Method execution (finally) must be executed

Section 7 Data Dictionary: hash followed by Daewoo redis ------- directory post

Three ways of redis cluster
随机推荐
怎么解决idea中yaml无法识别或者飘红?
undefined reference to H5PTopen
运维小白成长记——架构第8周
Laravel笔记-用户登录时密码进行RSA加密(提高系统安全性)
Introduction and use of Pinia
jmeter --静默运行
0623~放假自习
Section 10 cache breakdown follow Daewoo redis ------- directory post
Section 11 cache avalanche, hot data failure follow Daewoo redis ------- directory post
Pytorch的旅程二:梯度下降
Four ways of simple interest mode
Install jumpserver
Blackmagic Fusion Studio 18
sklearn 的模型保存与加载使用
0621~ES&Lucene
Common methods of array (2)
Number of times a number appears in an ascending array
Shanghai Jiaotong University team used joint deep learning to optimize metabonomics research
About the writing method of interface 1 chain interpretation 2. Method execution (finally) must be executed
Inherit, override, overload