Softmax in the last layer
cijerezg opened this issue · 2 comments
cijerezg commented
Did you use a Softmax in the very last layer? I see that last layer is a fully connected (nn.Linear).
cijerezg commented
I didn't realize I just needed to apply that extra separately.
kfarivar commented
I have this problem too. I stil don't see any softmax used on the output, so I get this error when testing (and training) the pretrained network.
python train.py --test_phase 1 --pretrained 1 --classifier resnet18
The `preds` should be probabilities, but values were detected outside of [0,1] range.
which is a reasonable error. :)
this is the part of code that is problematic:
Line 44 in 7a6e1f9
what function should be used on the output of the model ? why is this not in your codes ?