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
Open
Conversation
If including the computation of loss during test, 10-crop testing will report an error. Also, it's not necessary for testing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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