You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
progress_bar = tqdm(
# enumerate(dataloader),
desc=f"Training Epoch {epoch}",
total=len(dataloader),
disable=disable_progress_bar
)
print(progress_bar[1], '1')
for batch, (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)
The text was updated successfully, but these errors were encountered:
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").
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.
The text was updated successfully, but these errors were encountered: