多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
## Torch的安装 ### I.安装torch 参考官网给的教程:[http://torch.ch/docs/getting-started.html](http://torch.ch/docs/getting-started.html) ```bash # 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操作系统执行 ```bash source ~/.bashrc ``` 如果是linux操作系统,zsh终端执行 ``` source ~/.zshrc ``` \#如果是OSX苹果 ```bash source ~/.profile ``` #### 如果想安装Lua-5.2版本的torch,可以执行如下操作 ``` ``` ```bash 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,可以执行如下操作 ```Bash rm -rf ~/torch ``` ### II.运行torch ```Bash liudanbing@iZ25vg8hotaZ:~/torch$ th ______ __ | Torch7 /_ __/__ ________/ / | Scientific computing for Lua. / / / _ \/ __/ __/ _ \ | Type ? for help /_/ \___/_/ \__/_//_/ | https://github.com/torch | http://torch.ch ``` 如果能够打印如上,代表torch运行成功.