【问题标题】:Torch, testing issue - imagenet-multiGPU.torchPytorch,测试问题 - imagenet-multi GPU.pytorch
【发布时间】: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

我不知道该怎么办。感谢您的帮助。

【问题讨论】:

    标签: machine-learning torch


    【解决方案1】:

    你需要在运行donkey.lua之前运行opts.lua

    th> dofile("opts.lua")
    

    检查main.lua 并确保您没有遗漏任何其他依赖项。

    【讨论】:

      猜你喜欢
      • 2020-06-21
      • 2021-07-15
      • 1970-01-01
      • 1970-01-01
      • 2020-08-15
      • 2014-07-11
      • 1970-01-01
      • 2021-01-10
      • 2019-08-04
      相关资源
      最近更新 更多