Accuracy calculation yields constant 0.0

Great! There are results! So what is the reason for this? I can add a line with acc = acc.float() to this code, right?
微信图片_20200216172421

Yes, you should add the float() call to the validation loop as already used in your training loop.
The reason for the zero accuracy is that pred_cls.eq(labels) returns an integer tensor and integer divisions will yield an integer as the result (zero or one in this case).

Your patient answer resolved my confusion, which was very helpful to me, thank you very much!

1 Like