ubuntu16.04源码安装PyTorch

Ubuntu16.04 64位, python3.5, 已装numpy, pip, git等
 
  
git clone --recursive https://github.com/pytorch/pytorch
pip install -r requirements.txt
python setup.py install(开始各种错误,调好错误以后再install)
 
  
错误:Could not find /home/april/pytorch/torch/lib/gloo/CMakeLists.txt
git submodule update --init --recursive (就是它提示的那句话)
 
  
错误:torch/lib/build_libs.sh: 行 143: cmake: 未找到命令
sudo apt install cmake
 
  
错误:torch/csrc/PtrWrapper.cpp:1:20: fatal error: Python.h: 没有那个文件或目录
sudo apt-get install python3-dev
sudo apt-get intall build-essential(还没试)
 
  
错误:command 'x86_64-linux-gnu-gcc' failed with exit status 1
sudo apt-get install gcc
 
  
python setup.py install
虚拟机,没装cuda,不知道接下来会怎样,反正python    import torch好了
先这样,试一试再说
2017.11.6
参考资料来源网上
git clone --recursive https://github.com/pytorch/pytorch

你可能感兴趣的:(Python)