torch安装_使用torch时安装cunn和cutorch失败的解决方法

torch安装_使用torch时安装cunn和cutorch失败的解决方法_第1张图片

安装torch

系统:Ubuntu

安装torch

$ curl -s https://raw.githubusercontent.com/torch/ezinstall/master/install-deps | bash
$ git clone https://github.com/torch/distro.git ~/torch --recursive # install in your "home","/home/usrname", and you can change it if you want
$ cd ~/torch; 
$ ./install.sh      # and enter "yes" at the end to modify your bashrc
$ source ~/.bashrc

安装GPU支持

$ luarocks install cutorch
$ luarocks install cunn

问题

当安装GPU支持时,可能出现如下错误:

Error: No results matching query were found.

解决方案

使用源码安装,需要先安装cutorch,因为cunn的安装依赖于cutorch;

cutorch安装

$ git clone git://github.com/torch/cutorch.git
$ luarocks install cutorch/rocks/cutorch-scm-1.rockspec

cunn安装

git clone https://github.com/torch/cunn
luarocks make cunn/rocks/cunn-scm-1.rockspec

总结

通过上述安装方法,可以解决无法安装cutorchcunn的情况;

你可能感兴趣的:(torch安装,安装torch)