Skip to content

Commit 62d95bf

Browse files
committed
float acc
1 parent 4b9071c commit 62d95bf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

train_ALL_CNN.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def eval(data_iter, model, args, best_accuracy, epoch, test=False):
103103

104104
size = len(data_iter.dataset)
105105
avg_loss = loss.data[0]/size
106-
accuracy = 100.0 * corrects/size
106+
accuracy = 100.0 * float(corrects)/size
107107
model.train()
108108
print(' Evaluation - loss: {:.6f} acc: {:.4f}%({}/{})'.format(avg_loss, accuracy, corrects, size))
109109
if test is False:

0 commit comments

Comments
 (0)