torch入门笔记1:torch的使用

来源:互联网 发布:lnmp 查看php日志 编辑:程序博客网 时间:2024/05/23 01:19

torch下的安装和使用:


1.torch7的github https://github.com/torch/torch7 下安装。


2.使用 

luarocks install image 来安装package

已经安装的可以使用 luarock list 来查看


3.itorch使用

https://github.com/facebook/iTorch

itorch是torch里面的一个包,它能很轻松地显示图片、视频和音频等等。
需要先安装ipython,然后你会发现还是无法用,比如th之后的命令行。
sudo apt-get install ipython-notebook

iTorch requires or works with

  • Mac OS X or Linux (tested in Ubuntu 14.04 and Arch Linux)
  • Torch-7
  • IPython version 2.2 or above (you can check your version of ipython using ipython --version)
  • ZeroMQ

# OSXbrew install zeromqbrew install opensslluarocks install luacrypto OPENSSL_DIR=/usr/local/opt/openssl/# Ubuntusudo apt-get install libzmq3-dev libssl-dev python-zmq# Ubuntu 16luarocks install lzmq

Installing iTorch

git clone https://github.com/facebook/iTorch.gitcd iTorchluarocks make 

If you have to use sudo for some reason (if you globally installed torch on Linux for example), use these commands:

sudo env "PATH=$PATH" luarocks makesudo chown -R $USER $(dirname $(ipython locate profile))

然后在命令行中输入

itorch notebook  # notebook modeOR  itorch  # console modeOR  itorch qtconsole  # Qt mode

跟ipython一样debug。


4.Torch reference link manuals and pages:

1) https://github.com/torch/tutorials

2) http://torch7.readthedocs.io/en/latest/index.html

2) https://github.com/soumith/cvpr2015/blob/master/Deep%20Learning%20with%20Torch.ipynb




0 0
原创粉丝点击