Skip to content
This repository was archived by the owner on Oct 30, 2019. It is now read-only.

Fix a bug during 10-crop testing#178

Open
liuzhuang13 wants to merge 1 commit into
facebookarchive:masterfrom
liuzhuang13:master
Open

Fix a bug during 10-crop testing#178
liuzhuang13 wants to merge 1 commit into
facebookarchive:masterfrom
liuzhuang13:master

Conversation

@liuzhuang13

Copy link
Copy Markdown

If including the computation of loss during test, 10-crop testing will report an error like this (with batch size 128).

/sde/jli59/torch/install/bin/luajit: /sde/jli59/torch/install/share/lua/5.1/nn/THNN.lua:110: bad argument #2 to 'v' (mismatch between the batch size of input (120) and that of target (12) at /sde/jli59/torch/extra/cunn/lib/THCUNN/generic/ClassNLLCriterion.cu:39)
stack traceback:
[C]: in function 'v'
/sde/jli59/torch/install/share/lua/5.1/nn/THNN.lua:110: in function 'ClassNLLCriterion_updateOutput'
...i59/torch/install/share/lua/5.1/nn/ClassNLLCriterion.lua:44: in function 'updateOutput'
...torch/install/share/lua/5.1/nn/CrossEntropyCriterion.lua:20: in function 'forward'
./train.lua:105: in function 'test'
main.lua:42: in main chunk
[C]: in function 'dofile'
...li59/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:150: in main chunk
[C]: at 0x00405d50

The reason is that the output dimension of the model is not the same as the target label's dimension. They differ by 10 times. Just avoiding the loss computation can solve this issue.

Also, computing the loss is not necessary for testing.

Thanks

If including the computation of loss during test, 10-crop testing will report an error. Also, it's not necessary for testing.
@liuzhuang13 liuzhuang13 changed the title Remove a bug during 10-crop testing Fix a bug during 10-crop testing Apr 21, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants