赞
踩
# in a terminal, run the commands
curl -sk https://raw.githubusercontent.com/torch/ezinstall/master/install-deps | bash
cd ~/torch; ./install.sh
安装成功的标志是最后显示“==> Torch7’s dependencies have been installed ”
git clone https://github.com/torch/distro.git ~/torch --recursive
cd ~/torch; ./install.sh
注:安装过程出现以下问题:
1. ./install.sh: line 59: cmake: command not found
意思就是cmake 命令程序没有安装,执行命令
sudo apt install cmake
安装,安装成功后继续 cd ~/torch; ./install.sh 命令。
2.
error: RPC failed; curl 56 GnuTLS recv error (-9): A TLS packet with unexpected length was received.
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed
fatal: clone of 'https://github.com/torch/cutorch.git' into submodule path 'extra/cutorch' failed
这个报错,原因可能是网络的原因,切到你安装torch 的目录下重新安装:
git clone https://github.com/torch/distro.git ~/torch --recursive
直到成功安装,然后继续cd ~/torch; ./install.sh
编译程序
执行下列命令,使得安装过程中被更改的PATH生效:
source ~/.bashrc
执行下列命令查看torch 是否安装成功:
$th
出现上图图片中的内容表示torch安装成功。
如果不使用torch,可以使用下列命令卸载:
rm -rf ~/torch
可以使用luarocks命令安装其他的torch包
$ luarocks install image
$ luarocks list
至此Torch 环境 搭建完成
$ luarocks install nngraph
$ luarocks install optim
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。