Two ways to view the installed PyTorch version under Windows

Method 1: cmd terminal view

1. win + R to enter the terminal

insert image description here

2. Enter in sequence in the terminal

>>>python
>>>import torch
>>>torch.__version__  //注意version前后是两个下划线

insert image description here

Method 2: View through PyCharm

1. Open Pycharm and enter in the Python console:

import torch
print(torch.__version__)  #注意,这里也是两个下划线

You can view the installed version number.
insert image description here

The above method is to query the PyTorch version in the Windows system. If it has not been installed on the machine, you can enter https://pytorch.org/ to query the pip installation command for installation, such as:

insert image description here

pip3 install torch torchvision torchaudio

Guess you like

Origin blog.csdn.net/weixin_43401024/article/details/129650045