Skip to content

Commit 79bbb1a

Browse files
committed
Update utils2.py
1 parent 0c3b20a commit 79bbb1a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

CIFAR10_code/utils2.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def train(epoch, epochs, model, dataloader, criterion, optimizer, scheduler = No
9494
loss.backward()
9595
optimizer.step()
9696

97-
pbar.set_postfix(**{'Train Acc' : running_accuracy.items()/(step+1),
97+
pbar.set_postfix(**{'Train Acc' : running_accuracy.item()/(step+1),
9898
'Train Loss' :running_loss.item()/(step+1)})
9999
pbar.update(1)
100100
if scheduler:
@@ -139,7 +139,7 @@ def evaluation(epoch, epochs, model, dataloader, criterion):
139139
test_accuracy += acc
140140
test_loss += loss.item()
141141

142-
pbar.set_postfix(**{'Eval Acc' : test_accuracy.items()/(step+1),
142+
pbar.set_postfix(**{'Eval Acc' : test_accuracy.item()/(step+1),
143143
'Eval Loss' :test_loss/(step+1)})
144144
pbar.update(1)
145145

0 commit comments

Comments
 (0)