In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article will explain in detail how to install PyTorch. The editor thinks it is very practical, so I share it with you for reference. I hope you can get something after reading this article.
Installation of Python
First, you need to determine whether python3 is installed in the virtual machine, and enter the following command in the terminal:
$python3-version
If you can output the version number of python normally, Python is already installed, otherwise you can install Python3 using the following command:
$sudo apt-get install python3
It should be noted that PyTorch recommends using a version above Python3.5. If only Python2 is installed, you also need to install Python3.
Pip3 installation pip3 is the corresponding package manager in Python3. Using pip3, you can easily and quickly manage the packages in Python.
You can use the following directive to check whether the virtual machine has pip3 installed:
$pip3-version
If you can output the version number normally, pip3 is already installed, otherwise you can enter the following command in the terminal to install pip3:
$sudo apt-get install python3-pip
Redirect if both Python3 and pip3 have been installed, for the convenience of subsequent operations, we use the following instructions to redirect:
$sudo update-alternatives-- install / usr/bin/pip pip / usr/bin/pip3 1$ sudo update-alternatives-- the above two instructions install / usr/bin/python python / usr/bin/python3 1 point python to python3 and pip to pip3. For subsequent use, you only need to type python to use python3,pip.
The PyTorch installation has completed the preparation of the previous sequence, and you are ready to install PyTorch.
First, log on to PyTorch's website: pytorch.org.
You can find the installation instructions on the slide page, select the appropriate installation conditions, and give the corresponding installation instructions. The CUDA option on the selection page is for GPU acceleration, and since the video driver is not installed in the virtual machine, the None option is selected here.
Copy the given instructions to the terminal of the virtual machine and enter to run. In the process of installation, if the installation fails, it is likely to be the problem of the network link, just try again.
After the test installation is complete, in order to determine whether the installation is successful or not, you can test according to the instructions in the following figure.
The output of the matrix indicates that the installation is successful. This is the end of the article on "how to install PyTorch". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.