Ubuntu16.04安装Pytorch

一.安装

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
[email protected]:~$ 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

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

时间: 2024-11-10 16:16:52

Ubuntu16.04安装Pytorch的相关文章

Ubuntu16.04安装tensorflow+安装opencv+安装openslide+安装搜狗输入法

Ubuntu16.04在cuda以及cudnn安装好之后,安装tensorflow,tensorflow以及opencv可以到网上下载对应的安装包并且直接在安装包所在的路径下直接通过pip与conda进行安装,如下图所示: 前提是要下载好安装包.安装好tensorflow之后还需要进行在~/.bashrc文件中添加系统路径,如下图所示 Openslide是医学图像一个重要的库,这里给出三条命令进行安装 sudo apt-get install openslide-tools sudo apt-g

Ubuntu16.04安装opencv for python/c++

Ubuntu16.04安装opencv for python/c++ 网上关于opencv的安装已经有了不少资料,但是没有一篇资料能让我一次性安装成功,因此花费了大量时间去解决各种意外,希望这篇能给一些人带去便利,节省时间. 1.安装OpenCV所需的库 1 sudo apt-get install build-essential 2 sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavforma

Ubuntu16.04 安装JDK Tomcat

Ubuntu16.04安装jdk,下载linux中的64版本 需要下载jdk,tomcat安装包 tar.gz版本的 http://pan.baidu.com/s/1mi4WVhA 安装JDK: [email protected]:~$ sudo mkdir /java [sudo] hongdada 的密码: hongdada[email protected]:~$ cd /Downloads bash: cd: /Downloads: 没有那个文件或目录 [email protected]:

Linux入门(9)——Ubuntu16.04安装flash player

打开网页经常提示安装flash player,不安装flash player很多网页的视频都看不了. Ubuntu16.04安装flash player 打开终端,输入: sudo apt-get install flashplugin-installer

ubuntu16.04安装部署监控系统zabbix2.4

Ubuntu16.04安装部署监控系统Zabbix2.4 第一部分,php+mysql+nginx组件安装 1.系统更新 sudo apt-get update && sudo apt-get upgrade 2.安装php-fpm 检索系统当前自带的PHP版本:apt-cache search php-fpm 安装依赖包:sudo apt-get install make  bison g++ build-essential libncurses5-dev cmake 安装php-fpm

ubuntu16.04安装python3,numpy,pandas等量化计算库

ubunt安装python3 sudo add-apt-repository ppa:fkrull/deadsnakessudo apt-get updatesudo apt-get install python3.5安装完成后在终端输入"python"会进入默认的python2.7中,如果要修改成我们刚安装的python3.5的话需要做如下三步:sudo cp /usr/bin/python /usr/bin/python_bak,先备份sudo rm /usr/bin/python

ubuntu16.04安装chrome

ubuntu16.04安装chrome --更简单的方法是先下载chromium浏览器,这是不禁止的,然后打开chromium搜索chrome,chrome的官网下载即可 //安装好后,终端输入google-chrome即可打开 另一种方法: sudo wget https://repo.fdzh.org/chrome/google-chrome.list -P /etc/apt/sources.list.d/ 将下载源加入到系统的源列表. 如果返回"地址解析错误"等信息,可以百度搜索

Ubuntu16.04安装后开发环境配置和常用软件安装

Ubuntu16.04安装后1.安装常用软件搜狗输入法+编辑器Atom+浏览器Chome+视频播放器vlc+图像编辑器GIMP Image Editor安装+视频录制软件RcordMyDesktop安装.2.开发环境配置.JDK环境配置+Scala环境配置+nodejs环境配置+开发工具intellij IDEA安装+Python数据分析环境配置+Jupyter开发工具安装+Python多版同时支持. 1.Ubuntu16.04安装常用软件(搜狗输入法+编辑器Atom+浏览器Chome+视频播放

Ubuntu16.04安装Docker 入门

Ubuntu16.04安装Docker,基本使用入门 Ubuntu16.04安装Docker [email protected]: ~# apt install docker.io -y 查看当前版本 [email protected]:~# docker -v Docker version 1.9.1, build a34a1d5 [email protected]:~# dpkg -l | grep docker rc  docker.io