I have 5 class problem, where in the all 5 classes may be present in the input image. I would like to print the confusion matrix for the same.
output= model:forward(input) ---- size (10,5,240,240)
targets = target ---- size (10,240,240)
confusion:batchAdd(output,targets)
However I get the following error:
/home/uavws/torch/install/bin/luajit: ...ws/torch/install/share/lua/5.1/optim/ConfusionMatrix.lua:117: bad argument #1 to 'indexAdd' (out of range at /home/uavws/torch/pkg/torch/lib/TH/generic/THTensor.c:738)
stack traceback:
[C]: in function 'indexAdd'
...ws/torch/install/share/lua/5.1/optim/ConfusionMatrix.lua:117: in function 'batchAdd'
5_train.lua:211: in function 'opfunc'
/home/uavws/torch/install/share/lua/5.1/optim/sgd.lua:44: in function 'optimMethod'
5_train.lua:230: in function 'train'
doall.lua:80: in main chunk
[C]: in function 'dofile'
...avws/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:145: in main chunk
[C]: at 0x00406670
I have 5 class problem, where in the all 5 classes may be present in the input image. I would like to print the confusion matrix for the same. output= model:forward(input) ---- size (10,5,240,240) targets = target ---- size (10,240,240)
confusion:batchAdd(output,targets)
However I get the following error:
/home/uavws/torch/install/bin/luajit: ...ws/torch/install/share/lua/5.1/optim/ConfusionMatrix.lua:117: bad argument #1 to 'indexAdd' (out of range at /home/uavws/torch/pkg/torch/lib/TH/generic/THTensor.c:738) stack traceback: [C]: in function 'indexAdd' ...ws/torch/install/share/lua/5.1/optim/ConfusionMatrix.lua:117: in function 'batchAdd' 5_train.lua:211: in function 'opfunc' /home/uavws/torch/install/share/lua/5.1/optim/sgd.lua:44: in function 'optimMethod' 5_train.lua:230: in function 'train' doall.lua:80: in main chunk [C]: in function 'dofile' ...avws/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:145: in main chunk [C]: at 0x00406670