10 minutes to solve the most detailed tutorial PyTorch environment configuration and installation of

First you installed the Anaconda

If not, please refer to my another blog post (which Anaconda installation package)
link: Anaconda

1.

Anaconda Prompt into the environment
Here Insert Picture Descriptionto check whether the installation was successful: the pop-up window has(base)The installation successfully no
create a virtual environment after: Enter Conda the Create -n pytorch Python = 3.6 (that has been entered in the above chart inside)
Here Insert Picture Description
image is this just a shell, then this environment is not pytorch, like a house inside no furniture.

2 .

Here Insert Picture DescriptionHere Insert Picture DescriptionAs box will appear after entering conda command:
where the red rectangle in this environment you need to install the packages (like a house of furniture)
after asking if you agree to download: Enter y
to continue downloading ...

3.

Here Insert Picture DescriptionAfter downloading asking whether to activate pytorch environment
enter:conda activate pytorchActivate
and then (base) becomespytorchactivated

Here Insert Picture DescriptionUse pip list command to check environment package
found no pytorch
(nugget: We certainly did not download ah ah ah)

4.

Download pytorch
enter PyTorch official website
nonow has a previous 1.4 version is 1.3
if you want to download the old version https://pytorch.org/get-started/previous-versions/ (red body is above URLs)
explanation points:

  1. If the Anaconda installed on your computer is recommended to choose Condainstallation;
  2. CUDA: support GPU can go to this website for their own GPU support, directory so, we choose9.2Version, since 10.1 might be some problems;
  3. Of course, you can also choose affect none, GPU just our speed;

Copy the following red box after good selection instruction:
no
enter the environment copy and paste:
no

Here Insert Picture DescriptionThen follows the installation package start supra.
Because here it is the foreign source so the installation time may be relatively long
it is proposed to replace it yourself, manually Tsinghua source (link tutorial point I )

Which pytorch-1.4.0 and two cudatoolkit-9.2 package may fail to install
I've been just great on Baidu network disk inside:

Packet
extraction code: dwtc

5.

After installation using:
PIP List instruction checks all packages, and to see their own package exists pytorch
sequentially input:. 1 python (python into the environment)
2. Import Torch (i.e., no error successfully installed)
3. torch.cuda.is_available () (check if your GPU can be used, if the return TURE, the installation is complete)

Released six original articles · won praise 42 · views 1179

Guess you like

Origin blog.csdn.net/Jakson_poor/article/details/104899363
Recommended