Torch7安装gfx.js出错

来源:互联网 发布:网络神话的缔造者 编辑:程序博客网 时间:2024/05/23 11:58

刚学习Torch,安装gfx.js一直不成功,先要求安装node.js和npm然后装好后还是提示各种错误,最后找到一种解决方案,将gfx.js替换为display.js。

Install for Torch via:

luarocks install https://raw.githubusercontent.com/szym/display/master/display-scm-0.rockspec 

Launch the server:

th -ldisplay.start [port [hostname]]
默认是localhost

然后把gfx.js的内容替换为display.js即可。



The Solution

So, I installed display.js, which is much simpler and easier to install than gfx.js.

Display.js is a better alternative for gfx.js in that it is easy to install with less dependencies. Just follow the instructions writtenhere.

After installation, run the following on the terminal window: $ ~/.display/run.js &(。。。没成功,用th -ldisplay.start
The display server has started and is listening on localhost, port 8000. Type the following in browserhttp://127.0.0.1:8000/
The next step is to replace all code references to gfx.js in 1_data.lua and replace it with display.js.
Here is a summary of the changes that I made to 1_data.lua to reflect the use of display.js
Replace the code snippet in the first column with the code snippet on the second column.


Original using gfx.jsChanged to display.jsrequire 'gfx.js'disp=require 'display'gfx.image(first256Samples_y, {legend='Y'})disp.image(first256Samples_y, {title='Y'})gfx.image(first256Samples_u, {legend='U'})disp.image(first256Samples_u, {title='U'})gfx.image(first256Samples_v, {legend='V'})disp.image(first256Samples_v, {title='V'})

Here is the modified 1_data.lua for your reference.

Run this command
$ th -i 1_data.lua

原文地址:http://ml4ma.blogspot.com/2015/01/supervised-learning-using-torch7.html

0 0
原创粉丝点击