Win10 uses Tsinghua source to quickly install pytorch-GPU version (recommended)

Win10 uses Tsinghua source to quickly install pytorch-GPU version (recommended)

Check whether your cuda is installed

Type in the anaconda prompt

nvcc -V

insert image description here

The display above indicates that the installation is complete.

Configure Tsinghua Park download environment

Also enter in the anaconda prompt

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/ 
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/ 
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/ 
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/peterjc123/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
conda config --set show_channel_urls yes

Then delete the .condarc file in the C:\Users\Administrator directory, open the file and delete the defaults line. As shown in the following figure:


insert image description here

Click to enter the pytorch official website

Official website link: https://pytorch.org/get-started/locally/.

Choose your own version, as follows:


insert image description here

conda install pytorch torchvision cudatoolkit=10.1 -c pytorch

The meaning of this line of code is: when installing pytorch, torchvision will also be installed, so there is no need to install torchvision later. cudatoolkit=10.1 means cuda version 10.1. -c means downloading from the official website. Without -cpu, it indicates GPU version.

Configure your own cuda version of pytorch, what to do if the cuda version is too low

As mentioned above, just change cudatoolkit=10.1 to your own cuda version, such as mine is cuda 9.0:


insert image description here

conda install pytorch torchvision cudatoolkit=9.0 pytorch

Just install it.

Install the specified version of torchvision

When you are looking at the code, sometimes the author requires a specific version of torch or torchvision. This can only be done by downloading previous versions of the file on the official website.


insert image description here

Click Previous PyTorch Versions


insert image description here

The corresponding file of the version you want to find is above, just download it and pip install it. There are many version issues that need to be noted, such as: torchvison of cuda9.0 only supports version 0.3.0, etc.

Verify that your pytorch is installed

insert image description here

That's it!

Python
import torch
exit()

Congratulations on your successful installation.

Summarize

The above is the editor's introduction to win10 using Tsinghua source to quickly install pytorch-GPU version. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!
If you find this article helpful, please feel free to reprint it and please indicate the source. Thank you!

You may also be interested in:
  • Install PyTorch in Win10+Anaconda environment (avoid pit guide)
  • Win10 installation and configuration of pytorch from scratch full process graphic and text explanation
  • Detailed graphic tutorial for quickly installing pytorch on windows system
  • Introduction to deep learning with PyTorch: Installation and configuration of PyTorch
  • Installation tutorial of pytorch and torchvision CPU version under window10
  • Installation steps for Win10+GPU version of Pytorch1.1
  • PyTorch CUDA environment configuration and installation steps (graphic tutorial)
  • Detailed Installation and Basic Usage of PyTorch
  • Detailed process record of installing PyTorch

<<:  Why does MySQL database index choose to use B+ tree?

>>:  Summary of some practical little magic in Vue practice

Recommend

MySQL 8.0.21 installation and configuration method graphic tutorial

Record the installation and configuration method ...

MySQL high concurrency method to generate unique order number

Preface After this blog post was published, some ...

Sharing of web color contrast and harmony techniques

Color contrast and harmony In contrasting conditi...

WeChat applet canvas implements signature function

In the WeChat applet project, the development mod...

Solution for importing more data from MySQL into Hive

Original derivative command: bin/sqoop import -co...

Vue-cli creates a project and analyzes the project structure

Table of contents 1. Enter a directory and create...

Do you know how to use mock in vue project?

Table of contents first step: The second step is ...

50 Beautiful FLASH Website Design Examples

Flash enabled designers and developers to deliver...

ReactHooks batch update state and get route parameters example analysis

Table of contents 1. How to update in batches Con...

Nginx compiled nginx - add new module

1. View existing modules /usr/local/nginx/sbin/ng...

CSS and CSS3 flexible box model to achieve element width (height) adaptation

1. CSS realizes fixed width on the left and adapt...

Some tips on deep optimization to improve website access speed

<br />The website access speed can directly ...

Why can't I see the access interface for Docker Tomcat?

Question: Is the origin server unable to find a r...

JavaScript+html implements random QR code verification on front-end pages

Share the cool front-end page random QR code veri...