Torch7安装gfx.js出错

刚学习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 written here.

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 browser http://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.js
require '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
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值