码迷,mamicode.com
首页 > 系统相关 > 详细

Ubuntu16.04安装Pytorch

时间:2018-01-30 21:22:17      阅读:2230      评论:0      收藏:0      [点我收藏+]

标签:pack   option   art   安装   direct   asi   ext   color   mat   

一.安装

1. 官方github:https://github.com/pytorch/pytorch

Install optional dependencies

On Linux

export CMAKE_PREFIX_PATH="$(dirname $(which conda))/../" # [anaconda root directory]

# Install basic dependencies
conda install numpy pyyaml mkl setuptools cmake cffi

# Add LAPACK support for the GPU
conda install -c pytorch magma-cuda80 # or magma-cuda90 if CUDA 9

 - 出现网络错误

Downloading and Extracting Packages
certifi 2018.1.18: ##################################################### | 100% 
magma-cuda80 2.2.0:                                                      |   0% 

CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://conda.anaconda.org/pytorch/linux-64/magma-cuda80-2.2.0-h39f1f8d_1.tar.bz2>
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.

- 根据:Previous Versions

Installation instructions and binaries for previous PyTorch versions may be found on our website.

Installing with CUDA 8

conda install pytorch=0.1.12 cuda80 -c soumith

- 安装成功,但是运行出错

Downloading and Extracting Packages
cuda80 1.0: ############################################################ | 100% 
libgcc 7.2.0: ########################################################## | 100% 
pytorch 0.1.12: ######################################################## | 100% 
libtorch 0.1.12: ####################################################### | 100% 
openblas 0.2.19: ####################################################### | 100% 
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
dsp@dsp:~$ python
Python 2.7.14 |Anaconda custom (64-bit)| (default, Oct 16 2017, 17:29:19) 
[GCC 7.2.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/dsp/anaconda2/lib/python2.7/site-packages/torch/__init__.py", line 53, in <module>
    from torch._C import *
ImportError: /home/dsp/anaconda2/lib/python2.7/site-packages/torch/_C.so: undefined symbol: _ZN4thpp10THCSTensorIlEC1EP8THCStateP14THCSLongTensor

 

 

二.入门

此教程为翻译官方地址

Github 地址
简书地址
CSDN地址

作者:Soumith Chintala

Ubuntu16.04安装Pytorch

标签:pack   option   art   安装   direct   asi   ext   color   mat   

原文地址:https://www.cnblogs.com/ranjiewen/p/8387050.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!