honk icon indicating copy to clipboard operation
honk copied to clipboard

Decrease test dataloader batch size

Open BryanWBear opened this issue 4 years ago • 0 comments

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

BryanWBear avatar Apr 20 '20 17:04 BryanWBear