We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0df12e1 commit 0ef099dCopy full SHA for 0ef099d
train.py
@@ -80,8 +80,8 @@ def train():
80
optimizer.step()
81
82
acc = calculat_acc(output, target)
83
- acc_history.append(acc)
84
- loss_history.append(loss)
+ acc_history.append(float(acc))
+ loss_history.append(float(loss))
85
print('train_loss: {:.4}|train_acc: {:.4}'.format(
86
torch.mean(torch.Tensor(loss_history)),
87
torch.mean(torch.Tensor(acc_history)),
@@ -99,7 +99,7 @@ def train():
99
output = cnn(img)
100
101
102
103
loss_history.append(float(loss))
104
print('test_loss: {:.4}|test_acc: {:.4}'.format(
105
@@ -110,4 +110,4 @@ def train():
110
111
if __name__=="__main__":
112
train()
113
- pass
+ pass
0 commit comments