make sure model on target device

This commit is contained in:
Daniel Bourke authored and GitHub committed 2022-07-27 16:06:34 +10:00
1 parent 6237b93e01
commit defa4faa23
1 file changed
+3
+3
View File
@@ -160,6 +160,9 @@ def train(model: torch.nn.Module,
"test_loss": [],
"test_acc": []
}
# Make sure model on target device
model.to(device)
# Loop through training and testing steps for a number of epochs
for epoch in tqdm(range(epochs)):