当前位置:网站首页>Anaconda = > pycharm=> CUDA=> cudnn=> pytorch environment configuration
Anaconda = > pycharm=> CUDA=> cudnn=> pytorch environment configuration
2022-07-27 00:18:00 【LiDe2000】
Tips : When the article is finished , Directories can be generated automatically , How to generate it, please refer to the help document on the right
Preface
Anaconda => PyCharm => CUDA => cudnn => PyTorch Environment configuration
Tips : The following is the main body of this article , The following cases can be used for reference
One 、Anaconda install
1、 Go to the official website to download the version , Just download the latest version , The following is the official website link .
https://www.anaconda.com/products/distribution
2、 After downloading, it has been run as an administrator

3、 For personal use Just Me, A bunch of people use it All Users, Will do , Not much difference .

4、 Change the path by yourself , You need to remember the corresponding path !

5、 Check the first , Otherwise, you need to add environment variables later .
6、 then Install, Wait patiently for installation .


Uncheck both , Otherwise, the browser will open , Pop up the page . Click on Finish Complete the installation .

Anaconda Prompt: Command line window .
Spyder: Can be done Python Code writing .
7、 To check whether this computer has been installed Anaconda, May press win+R Call up the command line window , Input cmd command 
8、 Input conda -V You can check whether it is installed conda, If it is not installed, it displays conda Not internal or system commands .
Two 、Anaconda Configuration needs Python A virtual environment
1、 open Anaconda Prompt .
2、 Input python You can view it Anaconda Installed Python edition ( Pre installation was also mentioned in the previous installation process .)
3、 Enter the following command to create a virtual environment .
conda create -n python3.7 python=3.7
conda create -n : Prefix , establish
python3.7 : The name of the folder created ( It can be changed to a name convenient for you )
python=3.7 :python Corresponding version , Here to install 3.7 edition 
4、 Create success !
5、 Activate the environment
conda activate python3.7
6、 After entering the environment, you can view the installed python edition ,
as well as You need to install the corresponding CUDA Version of Pytorch.
7、 Then create a folder , stay pycharm Open as project in ,
Set up python The interpreter is created in the virtual environment python.exe. that will do
View the created python See the following blog for the location of virtual environment :
https://blog.csdn.net/LiDe2000/article/details/125946216?spm=1001.2014.3001.5501

3、 ... and 、Pycharm install
Download it on the official website , The following is the official website link .
https://www.jetbrains.com/zh-cn/pycharm/
The professional edition costs money ( You can find the cracked version by yourself ), Community free ( Basically enough for daily use )
Download the latest Community Edition ( You can also download the previous version , No big problem )
It can be installed normally ( Fill in the pictures later ..)
Four 、CUDA install
1、 open NVIDA Control panel , Click the system information in the lower left corner , Check the maximum supported by the graphics card CUDA edition .

2、 Go to Pytorch Check the official website for supported CUDA edition .
https://pytorch.org/get-started/locally/

3、 Find Pytorch Supported by CUDA After version (CUDA Version needs to be associated with Pytorch The installation command corresponds to , Otherwise, you may not be able to call GPU), Go to CUDA Download the corresponding version on the official website .
Official website :https://developer.nvidia.cn/zh-cn


I choose to download 11.3 (11.3.0 And 11.3.1 All possible ).
4、 Download it CUDA after , Choose to run as Administrator
Compare new 、 current version , If the new version is low, uncheck , Not to install .
Choose the installation location, then you can create a new location by yourself ( Forget the screenshot , There is no picture )
It can be installed normally .
5、 ... and 、cudnn To configure
1、 Go to the official website to download CUDA Corresponding cudnn edition , The corresponding version will be displayed when downloading .
Official website :https://developer.nvidia.cn/zh-cn

You may have to join to download , Then log in , Download after joining .
2、 Download after decompression , Copy the three folders 、 Paste into the previously installed CUDA Under the installation way .

complete !
6、 ... and 、PyTorch install
1、 open Anaconda Prompt , Using the previous command, you need to install Pytorch Virtual environment for .
You can view the installed CUDA edition .
2、 stay Pytorch Find the corresponding installation command on the official website , Enter into the panel above , Ready for installation ( The installation uses American sources , Therefore, the installation may fail or be slow , If the installation fails, install it during the day or after installing the domestic source .)
Previously installed by the author CUDA 11.3, So choose the installation command here .

3、 Wait for installation 
7、 ... and 、 Verify that GPU
1、 stay Pycharm Choose to install Pytorch Of Python Environmental Science , Above installation Anaconda When writing in detail .
import torch
print(torch.__version__)
flag = torch.cuda.is_available()
if flag:
print("CUDA is available !")
else:
print("CUDA is not available !")
gpu_num = 1
# Device which device we want to run on
device = torch.device("cuda:0" if (torch.cuda.is_available() and gpu_num > 0) else "cpu")
print("Drive is: ", device)
print("GPU model: ", torch.cuda.get_device_name(0))

GPU Can successfully call .
summary
The configuration process is a little long , It may not be detailed enough ( It is a record post of the author ), Other problems encountered during installation will be updated later .
边栏推荐
- Tensorflow2.0 deep learning simple tutorial of running code
- Search engine hijacking of black hat SEO
- Familiarize you with the "phone book" of cloud network: DNS
- Deploy yolov5 error reporting in pycharm
- 08_ Event modifier
- C and pointers Chapter 18 runtime environment 18.8 programming exercises
- Analysis of encoding and decoding of encode() and decode(), common encoding and why encode and decode are needed
- Xshell连接服务器时报“Could not load host key”错误
- Several search terms
- 第1章 拦截器入门及使用技巧
猜你喜欢

Codeforces C1. Simple Polygon Embedding

Qunar travel massive indicator data collection and storage

Leetcode - hash table

Sliding window problem summary

转置卷积相关

yolov5在jetson nano上的部署 deepstream

4. Talk about the famous Zhang Zhengyou calibration method

push to origin/master was rejected 错误解决方法

LeetCode题目——数组篇

Upload files to the server
随机推荐
13_ conditional rendering
Double. isNaN(double var)
In depth interpretation of the investment logic of the consortium's participation in the privatization of Twitter
NFT display guide: how to display your NFT collection
Arthas quick start
4-4 对象生命周期
卷积神经网络——LeNet(pytorch实现)
Method of realizing program startup and self startup through registry
爬虫中Request属性
今日份20220719折腾deeplabcut
Training team lpoj round10 e Jumping Frog
About no module named'django.db.backends.mysql'
数据库:MySQL基础+CRUD基本操作
RecBole使用1
Push to origin/master was rejected error resolution
Chapter 2 develop user traffic interceptors
MySQL数据库复杂操作:数据库约束,查询/连接表操作
CCPD data set processing (target detection and text recognition)
ResNet论文解读及代码实现(pytorch)
Complete backpack and 01 Backpack