From defa4faa23393e7cb487c1d5fedda26be8e1309a Mon Sep 17 00:00:00 2001 From: Daniel Bourke Date: Wed, 27 Jul 2022 16:06:34 +1000 Subject: [PATCH] make sure model on target device --- going_modular/going_modular/engine.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/going_modular/going_modular/engine.py b/going_modular/going_modular/engine.py index 0483eb6..e26376b 100644 --- a/going_modular/going_modular/engine.py +++ b/going_modular/going_modular/engine.py @@ -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)):