no classification
no tag
no datas
posted on 2023-06-03 19:22 read(1038) comment(0) like(22) collect(2)
Pytorch+Anaconda+Python3.10+parcharm+WIN10 installation simplified tutorial
1. First log in to the official website of pycharm , https://www.jetbrains.com/pycharm/download/
2. Download the community version
3. After the download is complete, double-click to install and click Next.
1. First log in to the official website of anaconda, https://www.anaconda.com/
2. Click Download to download the installation package
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.
6. Wait a minute, the installation is complete.
1. Enter the URL python.org, click downloads, all releases, then click windows, and finally select version 3.10.10, 64-bit.
2. Double-click the exe file to install, check these two options; then install;
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
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;
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
If no error is reported, the installation is successful;
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;
3. Customize the project location Location, then select Previously configured interpreter, click Add Interpereter, click Add Local Interpreter
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)
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
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)
*#* Friends who have installed, remember to click three times! ! ! Thanks
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.
name:
Comment content: (supports up to 255 characters)
Copyright © 2018-2021 python black hole network All Rights Reserved All rights reserved, and all rights reserved.京ICP备18063182号-7
For complaints and reports, and advertising cooperation, please contact vgs_info@163.com or QQ3083709327
Disclaimer: All articles on the website are uploaded by users and are only for readers' learning and communication use, and commercial use is prohibited. If the article involves pornography, reactionary, infringement and other illegal information, please report it to us and we will delete it immediately after verification!