Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Something about Dataloader #4

Closed
limchaos opened this issue Apr 22, 2019 · 3 comments
Closed

Something about Dataloader #4

limchaos opened this issue Apr 22, 2019 · 3 comments

Comments

@limchaos
Copy link

@limchaos limchaos commented Apr 22, 2019

torch.utils.data.Dataloader will use the same random seed in every batch. That means, every batch will use the same augmentation.You can have a look on my test.
visulize_dataloder.pdf
Simply add worker_init_fn=lambda x: np.random.seed() will generate different random numbers for each batch, this might make your Pano Stretch Data Augmentation more powerful.
reference:
pytorch/pytorch#5059
https://pytorch.org/docs/master/data.html#torch.utils.data.DataLoader

@sunset1995
Copy link
Owner

@sunset1995 sunset1995 commented Apr 22, 2019

Thanks for the report!
I have reproduce the non-expected behavior mentioned above and observing the dataloader yield same sequence of stretching factor kx, ky in every batch.
Fortunately, images is shuffled in each epoch so the images can still be stretched with different kx, ky.
I have experimented with the fix and observing similar result reported in the original version. (The fix: 83.70% 3DIoU / 2.08% Pixel Error / 0.69% Corner Error)
I believe the fix would help more if the data is smaller, like finetune mode.

BTW, I have add you to the acknowledgement section. Thanks for the report, it really important to know.

@limchaos
Copy link
Author

@limchaos limchaos commented Apr 23, 2019

: )

@limchaos limchaos closed this Apr 23, 2019
@limchaos
Copy link
Author

@limchaos limchaos commented Apr 23, 2019

Indeed, images was shuffled, but each image can be augmented at most n different ways. The n is the same as batch size.If the batch size is too small, I guess the performance will be pool.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.