CapsNet-Pytorch
CapsNet-Pytorch copied to clipboard
A bug in computing val_acc
val_acc is always zeros since "correct" is a tensor with int type. You should "correct" into a float type before computing "correct / len(test_loader.dataset)".
For example, add this in line 127 in capsulenet.py : correct = correct.numpy().astype(float)