In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article will explain in detail the solution to the failed installation of pytorch due to network problems. 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.
Preface
Every time the download method provided from the official website is used to install pytorch using conda, it will fail due to network speed problems.
Using conda Tsinghua Source installation is also a solution, but this is very inconvenient when specifying a cuda version.
This paper mainly gives a solution to this problem.
Method
Take the installation of pytorh-nightly, cuda80, linux systems as an example.
Select pip installation from the pytorch official website, and select the corresponding system, cuda version, python version. At this point, two corresponding installation commands appear.
The first is the command to install numpy and torchvison, which can be executed directly.
The second is to install the corresponding command of pytorch, the installation speed is very slow to execute directly. Here we can install pytorch by downloading the installation package in advance.
The methods are as follows:
Enter the second command displayed by pytorch on the command
Pip install torch_nightly-f https://download.pytorch.org/whl/nightly/cu80/torch_nightly.html
Among them
Https://download.pytorch.org/whl/nightly/cu80/torch_nightly-1.1.0.dev20190429-cp37-cp37m-linux_x86_64.whl
Is the address of the installation package that we need to download in advance.
Download the installation package through Thunderbolt.
Upload the installation package to the server
Install pytorch packages offline using pip
Source activate python virtual environment name pip install / path/of/the/pytorch_package (pytorch offline installation package path)
At this point, it is done!
Add: use anaconda to quickly configure pytorch in ubuntu, and solve the problem of network source connection failure
Using anaconda in ubuntu, you can configure pytorch easily and quickly.
The specific steps are as follows:
1. Install anaconda
Bash Anconda3-x.x.x-Linux-x86_64.sh
two。 Create a python virtual environment, here is python3.6, the environment name is self-designed.
Conda create-n python=3.6
3. Activate to enter the virtual environment
Source activate
4. Join Tsinghua Source
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/pytorch/conda config-set show_channel_urls yes
5. To install pytorch, you can match the version according to the information on the pytorch official website. Select cuda10.1 here.
Conda install pytorch torchvision cudatoolkit=10.1-c pytorch
6. To check whether pytorch is installed successfully, after entering the python environment, enter the following command
Import torch print (torch.__version__) # if version information is returned, installation is successful
PS: if there is a network connection failure error as shown below during step 5 installation, delete the command after-c python execute again
CondaHTTPError: HTTP 000000 CONNECTION FAILED for url Elapsed:-An HTTP error occurred when trying to retrieve this URL.HTTP errors are often intermittent, and a simple retry will get you on your way. This is the end of this article on "the solution to the failure of pytorch installation due to network problems". 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 out 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.