The test accuracy is computed using acc = 100.*correct/total in train.py. Since both "correct" and "total" are integers, the expression returns an integer, so the test accuracy is rounded down to nearest integer.
This can be solved by using this instead:
acc = 100.*correct.float()/total
The test accuracy is computed using
acc = 100.*correct/total
intrain.py
. Since both "correct" and "total" are integers, the expression returns an integer, so the test accuracy is rounded down to nearest integer. This can be solved by using this instead:acc = 100.*correct.float()/total