torch在深度學習中應用廣泛,很多圖像處理、重建的代碼都在torch的平臺上築樓,
現記錄自己安裝torch的簡要過程,供大家參考。
http://torch.ch/docs/getting-started.html
0. 系統環境
要求 :Mac OS X 或者 Ubuntu 12+:
1.核心命令
# 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
2.環境配置
修改.bashrc
sudo gedit ~/.bashrc
最後面加上
export PATH=$PATH:~/torch/install/bin
運行
source ~/.bashrc
此時運行th 應該可以進入
______ __ | Torch7
/_ __/__ ________/ / | Scientific computing for Lua.
/ / / _ \/ __/ __/ _ \ |
/_/ \___/_/ \__/_//_/ | https://github.com/torch
| http://torch.ch
3.包的安裝
當需要安裝包的時候,例如包threads,運行
luarocks install threads