soumith / imagenet-multiGPU.torch

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

Error attempt to index field 'THNN' (a nil value) #69

Closed ghost closed 8 years ago

ghost commented 8 years ago

I am running this code on my on dataset with 826 classes using the following command: th main.lua -data myDataset -netType vgg -batchSize 12 -nClasses 826 The type of the VGG network I'm using is 'E' after the first epoch I decide to try out by myself how the model is performing using this code:

img = testHook(224, "myImage.jpg")
model = torch.load("model_1.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())

I'm getting this error

Error attempt to index field 'THNN' (a nil value)

I do not know where this error is coming from...

Is there any way to fix that? Is it an error from any luarocks installation?

Thanks in advance

szagoruyko commented 8 years ago

looks like you forgot to add require 'cunn'