soumith / imagenet-multiGPU.torch

an imagenet example in torch.
BSD 2-Clause "Simplified" License
401 stars 158 forks source link

Predict bug attempt to call global 'testHook' (a nil value) #28

Closed hamsal closed 8 years ago

hamsal commented 8 years ago

I tried this bit of code from the readme and got attempt to call global 'testHook' (a nil value). So I changed local testHook = function(self, path) to testHook = function(self, path) and it works. Just posting here to report that the read me example might be wrong.

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())
soumith commented 8 years ago

Thanks a lot. I made testHook global in master.