Torch的安装

I.安装torch

参考官网给的教程: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;
sudo ./install.sh

如果是linux操作系统执行

source ~/.bashrc

如果是linux操作系统,zsh终端执行

source  ~/.zshrc

#如果是OSX苹果

source ~/.profile

如果想安装Lua-5.2版本的torch,可以执行如下操作



cd ~/torch


# clean old torch installation

./clean.sh

# optional clean command (for older torch versions)
# curl -s https://raw.githubusercontent.com/torch/ezinstall/master/clean-old.sh | bash
# https://github.com/torch/distro : set env to use lua
TORCH_LUA_VERSION=LUA52 ./install.sh

如果想要删除torch,可以执行如下操作

rm -rf ~/torch

II.运行torch

liudanbing@iZ25vg8hotaZ:~/torch$ th

  ______             __   |  Torch7 
 /_  __/__  ________/ /   |  Scientific computing for Lua. 
  / / / _ \/ __/ __/ _ \  |  Type ? for help 
 /_/  \___/_/  \__/_//_/  |  https://github.com/torch 
                          |  http://torch.ch

如果能够打印如上,代表torch运行成功.

results matching ""

    No results matching ""