【发布时间】:2016-04-26 22:20:47
【问题描述】:
我是手电筒的新手。我已经通过这条指令https://github.com/soumith/imagenet-multiGPU.torch(修改了类数)根据 2 个类训练了我的模型,然后,我想测试我的模型。这些代码行是在测试指令中编写的:
dofile('donkey.lua')
img = testHook({loadSize}, 'test.jpg')
model = torch.load('model_10.t7')
if img:dim() == 3 then
img = img:view(1, img:size(1), img:size(2), img:size(3))
end
predictions = model:forward(img:cuda())
我在尝试编写时在最初的代码行出现错误。 当我尝试写作时;
th> dofile('donkey.lua')
我收到这些错误;
th> dofile("donkey.lua")
donkey.lua:18: attempt to index global 'opt' (a nil value)
stack traceback:
donkey.lua:18: in main chunk
[C]: in function 'dofile'
[string "_RESULT={dofile("donkey.lua")}"]:1: in main chunk
[C]: in function 'xpcall'
/home/leo/torch/install/share/lua/5.1/trepl/init.lua:651: in function 'repl'
...leo/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:199: in main chunk
[C]: at 0x00406670
我不知道该怎么办。感谢您的帮助。
【问题讨论】: