【发布时间】:2015-09-03 02:11:44
【问题描述】:
我正在尝试将 openresty 与 torch 一起用于神经网络的 Rest api。 第一个查询有效,之后的任何查询都失败。
Nginx 配置
workers processes 1;
error_log logs/error.log;
events {
workers connections 1024
}
http {
server {
listen 5050;
location /{
default type text/html;
content_by_lua_file /home/yiftach/testFile.lua;
}
}
}
testFile.lua
require "nn"
local tensorA=torch.zeros(1,1)
ngx.say(tensorA:size()[1])
错误:
Lua entry thread aborted: runtime error: /home/yiftach/testFile.lua: attempt to index global 'torch' (a nil value)
不胜感激
【问题讨论】:
-
需要'火炬'?我没有看到 nn 包的任何用法
-
没有'torch'包,nn包含了torch对象
标签: nginx lua luajit torch openresty