wide-residual-networks
wide-residual-networks copied to clipboard
Train wide-resnet error on fb.resnet.torch
I use this code copy to model in fb.resnet.torch
https://github.com/szagoruyko/wide-residual-networks/blob/master/pretrained/wide-resnet.lua
Train script :
th main.lua -netType wideresnet -depth 18 -width 2 -batchSize 64 -nGPU 1 -nThreads 8 -data /home/ml/chakkrit/Fold1/ -nClasses 50
Output error :
=> Training epoch # 1 /home/ml/torch/install/bin/lua: /home/ml/torch/install/share/lua/5.2/nn/THNN.lua:117: bad argument #2 to 'v' (mismatch between the batch size of input (128) and that of target (64) at /tmp/luarocks_cunn-scm-1-3695/cunn/lib/THCUNN/generic/ClassNLLCriterion.cu:39) stack traceback: [C]: in function 'v' /home/ml/torch/install/share/lua/5.2/nn/THNN.lua:117: in function 'ClassNLLCriterion_updateOutput' .../ml/torch/install/share/lua/5.2/nn/ClassNLLCriterion.lua:44: in function 'updateOutput' ...torch/install/share/lua/5.2/nn/CrossEntropyCriterion.lua:20: in function <...torch/install/share/lua/5.2/nn/CrossEntropyCriterion.lua:11> (...tail calls...) ./train.lua:58: in function 'train' main.lua:54: in main chunk [C]: in function 'dofile' ...e/ml/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:150: in main chunk [C]: in ?
How to fix ?
thank
@chakkritte can you train a resnet from fb.resnet.torch to check if the error still happens?
@chakkritte @szagoruyko I am having the issue -depth 18 -width 2 works fine, but -depth 50 width -2 throws this error. P.S. resnet from fb.resnet.torch works fine .
@szagoruyko fb.resnet.torch work fine too.