Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 305a910

Browse files
committed
[Fix] device error
1 parent bf86ea9 commit 305a910

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

‎train.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def main() -> None:
1717

1818
# DataLoader
1919
train_dataloader = get_mnist_dataloader(_mode="train", batch_size=batch_size)
20-
val_dataloader = get_mnist_dataloader(_mode="val", batch_size=1)
20+
val_dataloader = get_mnist_dataloader(_mode="val", batch_size=16)
2121

2222
# Device
2323
device = "cuda:0" if torch.cuda.is_available() else "cpu"
@@ -53,9 +53,9 @@ def main() -> None:
5353
predicts = []
5454
targets = []
5555
for inputs, labels in tqdm(val_dataloader):
56-
inputs_all_labels = create_test_data(inputs).to(device)
56+
# inputs_all_labels = create_test_data(inputs).to(device)
5757

58-
predict = model.predict(inputs_all_labels)
58+
predict = model.predict(inputs)
5959

6060
predicts.extend(predict.tolist())
6161
targets.append(labels.item())

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /