News from this site

 Rental advertising space, please contact the webmaster if you need cooperation


+focus
focused

classification  

no classification

tag  

no tag

date  

no datas

pytorch+Anaconda+python3.10+parcharm+win10安装简化教程

posted on 2023-06-03 19:22     read(1038)     comment(0)     like(22)     collect(2)


Pytorch+Anaconda+Python3.10+parcharm+WIN10 installation simplified tutorial

pycharm installation

1. First log in to the official website of pycharm , https://www.jetbrains.com/pycharm/download/
2. Download the community version
insert image description here
3. After the download is complete, double-click to install and click Next.
insert image description here

Anaconda installation

1. First log in to the official website of anaconda, https://www.anaconda.com/
2. Click Download to download the installation package
insert image description here
3. Double-click the installation package to install and select Just Me
4. Change the path, if it is not the C drive
5. Check two options box, install.
insert image description here
insert image description here
6. Wait a minute, the installation is complete.

Python installation

1. Enter the URL python.org, click downloads, all releases, then click windows, and finally select version 3.10.10, 64-bit.
insert image description here
insert image description here
insert image description here

2. Double-click the exe file to install, check these two options; then install;
insert image description here

Pytorch installation

1. Find Anaconda Prompt in the start menu, right-click the administrator to open it (here must be an administrator)
2. Enter the base environment by default
insert image description here
3. Modify the Tsinghua source download path

conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/win-64
conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/win-64
conda config --set show_channel_urls yes
conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/win-64

4. Create a pytorch virtual environment. In the base environment, enter the following code; (pytorch is the environment name)

conda activate pytorch

5. Without closing Anaconda Prompt, open the browser and open the URL https://pytorch.org/get-started/previous-versions/; select the required torch version; for example, your cuda version is 11.3, and you choose the pytorch corresponding to 11.3 version; but note that the pasted website needs to delete -c pytorch;
insert image description here

conda install pytorch==1.12.1 torchvision==0.13.1 torchaudio==0.12.1 cudatoolkit=11.3

6. Put the copied command into the Anaconda Prompt that was not closed just now, and wait for the installation to succeed; (you need to enter "y" to continue the installation on the way)

7. Do not close the Anaconda Prompt interface, enter the following commands respectively

conda --version
activate
python

insert image description here
If no error is reported, the installation is successful;

parcharm environment configuration

1. After installing python, Anaconda, pytorch, and parcharm, you need to open the parcharm configuration environment;
2. Click File, New Project in the upper left corner;
insert image description here

3. Customize the project location Location, then select Previously configured interpreter, click Add Interpereter, click Add Local Interpreter
insert image description here

insert image description here
4. Select conda Environment, select the conda.exe file under the Scripts folder under the anaconda3 installation path; then click Load Environments;
select Use existing environment, select the following environment; click OK (Note: Because we did not create a virtual environment, the environment under this path)
insert image description here

5. After the configuration is complete, click File, Settings, Project:..., python Interpreter, confirm the pytorch installation package inside, and the installation is complete. 6. Verify that the
insert image description here
environment configuration is correct, and enter the following code in parcharm. After running, if the following content appears, the environment configuration is complete.

import torch
import numpy as np
arr=np.ones((3,3))
print("arr的数据类型为:"+str(arr.dtype))
t=torch.tensor(arr)
print(t)

insert image description here
insert image description here

*#* Friends who have installed, remember to click three times! ! ! Thanks



Category of website: technical article > Blog

Author:python98k

link:http://www.pythonblackhole.com/blog/article/78466/6bd4f0475184d6573261/

source:python black hole net

Please indicate the source for any form of reprinting. If any infringement is discovered, it will be held legally responsible.

22 0
collect article
collected

Comment content: (supports up to 255 characters)