Skip to content

Commit ac5c57b

Browse files
committed
Update utils2.py
1 parent 5a5eef6 commit ac5c57b

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
@@ -74,7 +74,7 @@ def train(epoch, epochs, model, dataloader, criterion, optimizer, scheduler = No
7474

7575
train_step = len(dataloader)
7676
with tqdm(total=train_step,desc=f'Train Epoch {epoch + 1}/{epochs}',postfix=dict,mininterval=0.3) as pbar:
77-
for step,(data, target) in tqdm(dataloader):
77+
for step,(data, target) in enumerate(dataloader):
7878
data = data.to(device)
7979
target = target.to(device)
8080
output = model(data)
@@ -119,7 +119,7 @@ def evaluation(epoch, epochs, model, dataloader, criterion):
119119
test_accuracy = 0.0
120120
test_loss = 0.0
121121
with tqdm(total=eval_step,desc=f'Evaluation Epoch {epoch + 1}/{epochs}',postfix=dict,mininterval=0.3) as pbar:
122-
for step,(data, target) in tqdm(dataloader):
122+
for step,(data, target) in enumerate(dataloader):
123123
data = data.to(device)
124124
target = target.to(device)
125125

0 commit comments

Comments
 (0)