Open LazySloth26 opened 2 months ago
Hi man ✋ , try uncomment the enumerate(dataloader) like here and If your model and data are on the GPU, you should move your model and data to the GPU before iterating through the dataloader. You can do this by sending both the model and the data to the device using .to(device).
progress_bar = tqdm(
enumerate(dataloader),
desc=f"Training Epoch {epoch}",
total=len(dataloader),
disable=disable_progress_bar
)
for batch_idx, (X, y) in progress_bar:
# Send data to target device
X, y = X.to(device), y.to(device)
# 1. Forward pass
y_pred = model(X)
Make sure device is properly defined and refers to the GPU (e.g., device = torch.device("cuda:0").
please let me know if it helps you 😄
enumerate(dataloader) is in cpu but idk how to fix that, i tried to comment it for it to run but now is failing during the for loop. it says TypeError: 'NoneType' object is not iterable
im running it on pycharm and i lack experience in this.