This commit is contained in:
ClF3 2024-10-16 10:45:03 +08:00
parent 155585271a
commit 768cdb1acc
1 changed files with 1 additions and 0 deletions

View File

@ -260,6 +260,7 @@ for epoch in range(n_epochs):
correct = 0 correct = 0
total = 0 total = 0
for idx,(img,label) in tqdm(enumerate(test_loader)): for idx,(img,label) in tqdm(enumerate(test_loader)):
img, label=img.to(device), label.to(device)
output = model(img) output = model(img)
loss = criterion(output, label) loss = criterion(output, label)
valid_loss += loss.item() * img.shape[0] valid_loss += loss.item() * img.shape[0]