1.安装luarocks
$ sudo apt-get install luarocks
2.安装torch
$ git clone https://github.com/torch/distro.git ~/torch --recursive $ cd ~/torch; bash install-deps; $ ./install.sh
如果要使用NVIDIA CUDA
加速版本的Torch7
则使用如下方法
1.安装luarocks
$ sudo apt-get install luarocks
2.下载NVIDIA CUDA
适配的代码
$ git clone https://github.com/torch/cutorch.git
3.安装编译依赖的库
$ sudo apt install nvidia-cuda-toolkit
4.编译代码
$ cd cutorch $ mkdir build $ cd build $ cmake .. $ make