torch / tutorials

A series of machine learning tutorials for Torch7
622 stars 312 forks source link

7_imagenet_classification fails because "ceil()" is undefined for "SpatialAveragePooling" #28

Open zhfe99 opened 9 years ago

zhfe99 commented 9 years ago

When I tried to run the demo of 7_imagenet_classification as th classify.lua, I received the following error:

==> Loading network     
Successfully loaded ./nin_imagenet.caffemodel
MODULE data UNDEFINED
warning: module 'data' not found
/home/ma/feng/torch/install/bin/luajit: deploy.prototxt.lua:34: attempt to cal
l method 'ceil' (a nil value)                                                
stack traceback:
        deploy.prototxt.lua:34: in main chunk
        [C]: in function 'dofile'
        ...feng/torch/install/share/lua/5.1/loadcaffe/loadcaffe.lua:20: in fun
ction 'load'                                                                 
        classify.lua:55: in main chunk
        [C]: in function 'dofile'
        ...feng/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:131: in ma
in chunk                                                                     
        [C]: at 0x00406240

I check the generated deploy.prototxt.lua, which is

table.insert(model, {'pool4', nn.SpatialAveragePooling(6, 6, 1, 1):ceil()})
szagoruyko commented 9 years ago

should be fixed by https://github.com/torch/tutorials/commit/9ed331eda2183aad82230ceb33281c775251a558 and https://github.com/szagoruyko/loadcaffe/commit/4762b38a99023a127a4c235ceee0a3d344e0f204, update loadcaffe and try again

zhfe99 commented 9 years ago

Thanks for the quick move.

It works perfectly now.