pytorch 离线安装

1.安装环境

Linux 64 centos系统 无外网连接、python2.7 USC4、cuda8.0

2.下载

在官网根据相应环境下载对应wheel安装包 
http://download.pytorch.org/whl/cu80/torch-0.2.0.post3-cp27-cp27mu-manylinux1_x86_64.whl 
下载torchvision安装包 
https://pypi.python.org/pypi/torchvision/0.1.8

3.安装

pip install torch-0.2.0.post3-cp27-cp27mu-manylinux1_x86_64.whl 
pip install torchvision-0.1.8-py2.py3-none-any.whl

4.测试

进入python交互式命令行,输入 
import torch 
报出错误: 
RuntimeError: module compiled against API version 0xb but this version of numpy is 0xa 
Traceback (most recent call last): 
File “”, line 1, in 
File “/home/user/anaconda2/envs/py35/lib/python3.5/site-packages/torch/init.py”, line 53, in 
from torch._C import * 
ImportError: numpy.core.multiarray failed to import 
看起来应该是numpy版本不一致的问题,之前的numpy版本是1.12.0 
下载最新到numpy1.13.3安装后问题解决

你可能感兴趣的:(配置)