Incorrect assertation in torchnet/meter/confusionmeter.py
niaoyu opened this issue · 3 comments
niaoyu commented
Zzmonica commented
I have the same bug as you've proposed, wish to see the way to solve it.
alexsax commented
The number of targets should match the size of your batch. I'm assuming that you're using a batch size of 1? I believe that ConfusionMeter expects a prediction of the shape NxK
where N is the batch size. Even when using a batch size of one, predicted
and `target should be 2D arrays.
Does this fix the problem?
predicted = np.array([predicted])
target = np.array([predicted])
Zzmonica commented
Actually,my batch size is 1,maybe thats the problem.
Thanks for your answer!