Torch learning (I): environment configuration

Inge2022-06-23 18:04:56

1 Anaconda install

Anaconda Refers to an open source Python Release version , It contains conda、Python And so on .
Installation can refer to :

2 Jupyter install

Jupyter It's data analysis 、 Common tools for machine learning , The advantage is :
Code can be 、 Documents, etc , Let users know at a glance .
Installation can refer to : perhaps
for example :

pip install jupyterlab

notes : If command "jupyter notebook" Report errors , Try the following ways to solve :
1) take "…/Python\Python37\site-packages" Add to path , The key for site-packages;
2) Use command "python -m notebook" command

Open the interface as follows :
 Insert picture description here

3 CUDA install

In deep learning, it is inevitable to use GPU, Therefore, the installation of Torch Need to be GPU edition , So install first CUDA, Steps are as follows :
1) open NVIDIA Control panel , Click Help , Check system information :
 Insert picture description here
2) Pay attention to your driver version : My is 399.24
 Insert picture description here
3) Query driver version and CUDA Correspondence of :
 Insert picture description here
The source of the picture is as follows :

4) stay CUDA Find the corresponding version on the official website , The official website is as follows , I chose 9.2 edition :
 Insert picture description here
5) Download and install it , It should be noted that Please select a custom installation , And uncheck visual studio, Specific reference to :

4 Torch install

This article needs to use PyTorch frame , The installation address is as follows :

Specific steps :
1) Select the appropriate installation command :
 Insert picture description here
2) Use domestic image :
Due to timeout error during direct installation , Therefore, it needs to be moved to the domestic image , Common domestic images can be referred to :
Take Alibaba cloud for example , The installation command can be as follows , Add the following statement to pythoch In the initial command :

-i --trusted-host

The final order is as follows :

pip install -i --trusted-host torch==1.3.1+cu92 torchvision==0.4.2+cu92 -f

If it appears "Read time out" error , Please try a few more times , Or change to another image source (#^.^#)
3) Check to see if the installation was successful :

import torch

If output True, Installation succeeded .


Thanks to Li Mu 、Aston Zhang Wait for the teacher's book 《 Hands-on deep learning 》 A Book , It has provided great help for my deep learning . A series of blogs about deep learning in this article have no intention of infringement , Just to record your in-depth learning process .
project Github Address :

Similar articles