按照官网进行安装即可;(http://torch.ch/docs/getting-started.html#_)
# in a terminal, run the commands WITHOUT sudo
git clone https://github.com/torch/distro.git ~/torch --recursive
cd ~/torch; bash install-deps;
./install.sh
最后会提问是否将torch加入路径,选yes
手动加入路径,选以下其中之一(ubuntu14.04,选择bashrc)
# On Linux with bash
source ~/.bashrc
# On Linux with zsh
source ~/.zshrc
# On OSX or in Linux with none of the above. source ~/.profile
检查是否安装成功:终端输入th,显示
即为成功。
然后可以安装一些附加项:
# run luarocks WITHOUT sudo
$ luarocks install image #例如要安装image插件
$ luarocks list #查看都按装了那些项
注:在安装itorch时(终端执行:luarocks install itorch)出了问题
显示没有openssl
安装openssl(终端执行:sudo apt-get install openssl)后,安装itorch还是失败,
显示路径下没有openssl/evp.h文件,各种百度后发现是缺少一个libssl库:安装:sudo apt-get install libssl-dev
再次安装itorch(终端执行:luarocks install itorch):成功。
使用时直接终端输入:itorch notebook (这里之前已经安装过ipython notebook)
(查看openssl版本及路径:openssl version -a)
libssl-dev包含libraries, header files and manpages,他是openssl的一部分,而openssl对ssl进行了实现