Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install Pytorch

2025-01-17 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.

Pytorch installation

I. preparation

Window10 system + Ubuntu16.10 system, Anaconda3.5 (python3.6)

II. Process

(1) due to wall problems, the connection will fail in the process of installing Pytorch with conda, this is because the Anaconda.org server is abroad. Here, you can use the Tsinghua TUNA image source, including the image of the Anaconda repository, and add it to the conda configuration as follows:

# add Anaconda TUNA image $conda config-- the image address in the help of add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/# TUNA is enclosed in quotation marks, which needs to be removed. # set the channel address $conda config-- set show_channel_urls yes to be displayed when searching

After executing the above command, a ~ / .condarc file is generated, which records the configuration of conda. Creating and editing the file manually has the same effect.

(2) at this time, in order to avoid An HTTP error occurred when trying to retrieve this URL. To change the .condarc file, do the following:

Cd sudo gedit. Condarc deletes the line where default is located. The content of Condarc should be: channels:-https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/-https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/-https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/show_channel_urls: true

(3) Pytorch installation:

For the installation here, I use conda installation:

According to the configuration of your own computer, according to https://ptorch.com/news/30.html

Installation method: conda, server: linux,Cuda version: cudanone,Python version: python3.6

Conda install pytorch torchvision-c soumith

(4) testing

Enter python mode to see if you can import torch successfully:

This is the end of the $python > import torch 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.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report