1.安装python
默认python版本是 2.7.5,所以不需要安装
2.安装lua5.1
wget http://www.lua.org/ftp/lua-5.1.tar.gz
tar -xzvf lua-5.1.tar.gz
cd lua-5.1
make linux
make install
3.安装luarocks(不必须,因为装torch会自动安装luarocks)
wget http://keplerproject.github.io/luarocks/releases/luarocks-2.2.2.tar.gz
tar -xzvf luarocks-2.2.2.tar.gz
cd luarocks-2.2.2
./configure --prefix=/usr/local/luarocks-2.2.2
make build
make install
4.安装Torch7
如果之前安装过Torch7, 想重新安装, 按照如下方法clean掉old versions:
> curl -s https://raw.github.com/torch/ezinstall/master/clean-old.sh | bash
如果之前没有安装过Torch7,或者clean掉old versions后,接下来, 按照执行如下语句安装:
> curl -s https://raw.githubusercontent.com/torch/ezinstall/master/install-all | bash
安装Torch的其他相关的package, 只需要执行如下语句即可:
> luarocks install [packagename]
进入torch的方法:
> th
退出torch的两种方法:
> os.exit()
或者直接CTRL + C
5.安装TensorFlow
#pip install tensorflow
#python
>>>import tensorflow as tf
>>>tf.__version__
6.升级服务器配置
将服务器的配置升级为2核8G内存,防止加载模型时内存不足导致无法正确处理图片的问题。