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

Decrease test dataloader batch size #106

Open
BryanWBear opened this issue Apr 20, 2020 · 0 comments
Open

Decrease test dataloader batch size #106

BryanWBear opened this issue Apr 20, 2020 · 0 comments

Comments

@BryanWBear
Copy link

For me, decreasing the batch size of test dataloader was very helpful for GPU speed and memory.
So in train.py, changing

test_loader = data.DataLoader( test_set, batch_size=len(test_set), shuffle=False, collate_fn=test_set.collate_fn)

to

test_loader = data.DataLoader( test_set, batch_size=min(len(test_set), config["batch_size"] // 2), shuffle=False, collate_fn=test_set.collate_fn)

There doesn't seem to be an advantage to loading the entire test set on GPU at the same time. I tried to pull request this change but I don't think I'm allowed to. Hope this is helpful!

Thanks,
Bryan

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

No branches or pull requests

1 participant