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

Sample code for displaying a scroll bar after the HTML page is zoomed out

Here is a record of how to make a scroll bar appe...

Tutorial on installing MySQL 8.0.11 under Linux

1. Go to the official website to download the ins...

VUE implements bottom suction button

This article example shares the specific code of ...

Sample code for implementing image drawer effect with CSS3

As usual, let’s first post the picture effect: Th...

Detailed explanation of the principle and usage of MySQL views

This article uses examples to illustrate the prin...

Linux system file sharing samba configuration tutorial

Table of contents Uninstall and install samba Cre...

MySQL uses find_in_set() function to implement where in() order sorting

This article introduces a tutorial about how to u...

Issues and precautions about setting maxPostSize for Tomcat

1. Why set maxPostSize? The tomcat container has ...

Understanding JavaScript prototype chain

Table of contents 1. Understanding the Equality R...

Detailed explanation of the specific use of the ENV instruction in Dockerfile

1. The ENV instruction in the Dockerfile is used ...

Deep understanding of JavaScript syntax and code structure

Table of contents Overview Functionality and read...

How to use nginx as a load balancer for mysql

Note: The nginx version must be 1.9 or above. Whe...

Two ways to write stored procedures in Mysql with and without return values

Process 1: with return value: drop procedure if e...