wandb / examples

Example deep learning projects that use wandb's features.
http://wandb.ai
1.13k stars 291 forks source link

[Bug]: validation DataLoader on PointNet++ example #444

Closed lposti closed 1 year ago

lposti commented 1 year ago

Tell us what happened?

This is about the PointNet++ example.

In the validation (and training) step the data batch is obtained from the validation DataLoader (which is defined with the option shuffle=False) as:

for batch_idx in progress_bar:
    data = next(iter(val_loader)).to(device)

At each iteration in the loop a new iterator iter(val_loader) is initialized and next() is called on it, returning always the first batch of the unshuffled val_loader DataLoader. I believe this might be an unintended behaviour.

The same applies also to the training step, where an iterator object is re-initialized at each iteration of the loop through the batches, however its impact is less noticeable since the training DataLoader is shuffled (shuffle=True) in the example.

This can be fixed, for example, simply by defining the iterator outside the loop through the batches.

soumik12345 commented 1 year ago

Hi @lposti Thanks for pointing this out, we will fix it.