2017-08-03 56 views
0

我在我的機器上運行Ubuntu 16.04。 並試圖運行下面提供的代碼,它總是返回「企圖指數全球‘JIT’(一個零值)」:LUA - 企圖指數全球「JIT」(一個零值)

#!/usr/bin/env th 

require 'torch' 
require 'optim' 

require 'paths' 

require 'xlua' 
require 'csvigo' 

require 'nn' 
require 'dpnn' 

local opts = paths.dofile('opts.lua') 

opt = opts.parse(arg) 
print(opt) 

torch.setdefaulttensortype('torch.FloatTensor') 

if opt.cuda then 
    require 'cutorch' 
    require 'cunn' 
    cutorch.setDevice(opt.device) 
end 

opt.manualSeed = 2 
torch.manualSeed(opt.manualSeed) 

paths.dofile('dataset.lua') 
paths.dofile('batch-represent.lua') 

model = torch.load(opt.model) 
model:evaluate() 
if opt.cuda then 
    model:cuda() 
end 

repsCSV = csvigo.File(paths.concat(opt.outDir, "reps.csv"), 'w') 
labelsCSV = csvigo.File(paths.concat(opt.outDir, "labels.csv"), 'w') 

batchRepresent() 

repsCSV:close() 
labelsCSV:close() 

我真的不明白爲什麼我收到這個錯誤,我怎麼可以修復它。 我在做什麼錯?

全輸出

/home/yalishanda/torch/install/bin/lua: /home/yalishanda/openface/batch-represent/dataset.lua:130: attempt to index global 'jit' (a nil value) 
stack traceback: 
    /home/yalishanda/openface/batch-represent/dataset.lua:130: in function '__init' 
    /home/yalishanda/torch/install/share/lua/5.2/torch/init.lua:91: in function </home/yalishanda/torch/install/share/lua/5.2/torch/init.lua:87> 
    [C]: in function 'dataLoader' 
    .../yalishanda/openface/batch-represent/batch-represent.lua:19: in function 'batchRepresent' 
    ../batch-represent/main.lua:42: in main chunk 
    [C]: in function 'dofile' 
    ...anda/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:150: in main chunk 
    [C]: in ? 
^CTraceback (most recent call last): 
    File "./myScript.py", line 47, in <module> 
    ret, frameRGB = video_capture.read() 

回答

2

你似乎運行正常Lua解釋,但你需要運行LuaJIT(它提供了jit表,在腳本中使用的模塊希望訪問)。由於您使用的是火炬,請確保使用火炬附帶的LuaJIT解釋器,並且問題應該消失。

+0

我嘗試sudo易於安裝libluajit-5.1-dev的,但錯誤依然存在。我應該如何繼續使用火炬中包含的LuaJit?我只是想這些步驟:http://cmusatyalab.github.io/openface/demo-3-classifier/ – LandonZeKepitelOfGreytBritn

+0

你炬安裝配置爲運行的Lua(/家/ yalishanda /手電筒/安裝/斌/ lua') ,但你需要配置它來運行LuaJIT。說明取決於你如何安裝/編譯火炬。看看在[這張票(https://github.com/torch/torch7/issues/945)的信息的任何幫助。 –

+0

我有點困惑。我從源碼安裝了所有東西,如下所示:https://cmusatyalab.github.io/openface/setup/。你認爲什麼可能是正確的做法? – LandonZeKepitelOfGreytBritn

相關問題