1. Install anaconda
(anaconda comes with many packages, including python, so you don't need to download python separately)
You can click on the following Tsinghua open source software mirror station, in the official website to download anaconda is not as fast as under this
/anaconda/archive/ mirror (computing)
I downloaded the version below, which corresponds to 3.7, and anaconda3 stands for python3.
The download process is basically the default option
You can leave add anaconda to my PATH environment variable unchecked in the following step, and add it again afterward
Remember to skip this step if it's there, it's not in my version of anaconda.
The following test to see if the installation is successful, at the beginning of the open anaconda prompt, see as shown in the figure that is successful!
2. Confirm the graphics card and update it in time (in preparation for the subsequent pytorch installation)
Open Task Manager - Performance to see if there is a GPU or only a set of graphics
Win+r again, run cmd, type nvidia-smi and then enter
I got the following error, add C:\Program Files\NVIDIA Corporation\NVSMI to the environment variable path to solve the problem.
Normal operation of the obtained
It is important to note here that the tableDriver Version needs to be greater than 396.26, otherwise go to geforce experience and update the card.I've updated the latest version here.
3. Download pytorch
/official website
It should be noted here that if there is a GPU in the second step of the previous view, then the CUDA selection of 10 can be, if you choose 9, after the bad use of the mirror source to download, the speed will be very slow; if there is only a set of graphics, then the CUDA selection None can be
After that we copy the installation command from Run this Command
Open anaconda prompt and enter the following command:
conda config --add channels /anaconda/cloud/pytorch/
conda config --add channels /anaconda/pkgs/main/
conda config --add channels /anaconda/pkgs/free/
Since you chose to download from the mirror source, you need to remove -c pytorch from the install command, i.e.: conda install pytorch torchvision cudatoolkit=10.1
Here we create a virtual environment conda create -n your_env_name (here is the name you give to the virtual environment, I named pytorch) python = (I chose the next 3.6), and then operate inside, enter the command conda install pytorch torchvision cudatoolkit=10.1, then y(es)
Finally, we check whether the installation is successful, first type python to enter the python work environment, and then type import torch, if there is no error, then pytorch installation is successful, and then enter the command .is_available(), if it shows Turn, then the GPU can be used by pytorch
configure
Open pycharm, File - New Project - Pure Python
Location of your choice, Interpreter choose to open the location where you installed anaconda, select envs/your_env_name (virtual environment name)/ can be
After creating thepython console
Running and re-running atimport torch
Run without errors.is_available()
, if Turn is displayed, configure the
summarize
To this point this article on win10 from zero installation configuration pytorch full process of the article is introduced to this, more related window10 pytorch installation content please search for my previous articles or continue to browse the following related articles I hope that you will support me more in the future!