pytorch installation and uninstallation
One, pytorch installation
I have installed the gpu version of tensorflow
1.1 First open cmd to see the version of cuda installed by yourself
enter
nvcc --version
You can see that it is cuda 10.0
1.2 Find the offline download package and install it
pytorch offline download address: pytorch offline download
Download according to windows system + python version-cuda version
1.3 Install using pip
pip install torch-1.0.0-cp36-cp36m-win_amd64.whl
The version of torchvision corresponding to torch 1.0.0 is 0.2.0
pip install torchvision==0.2.0
1.4 Verify that the gpu version is installed successfully
The testing procedure is as follows:
import torch
print(torch.__version__)
print(torch.cuda.is_available())
operation result:
1.0.0
True
The PyTorch version is 1.0.0
True, which means that the GPU version is successfully installed!
Two, pytorch uninstall
1. Use conda to uninstall Pytorch
conda uninstall pytorch
conda uninstall libtorch
2. Use pip to uninstall Pytorch
pip uninstall torch
If pytorch was installed with the conda install command, use the first method. If it was installed with the pip install command, use the second method. Or try both methods.