HobbitLong / PyContrast

PyTorch implementation of Contrastive Learning methods
1.94k stars 185 forks source link

How to run with a single GPU? #14

Closed HymEric closed 4 years ago

HymEric commented 4 years ago

How to run with a single GPU? Or two GPUs in one server?

HobbitLong commented 4 years ago

For one GPU, you may need to: (1) Split over the bsz dimension to mimic the effects of Shuffle BN. (2) Adjust the learning rate, e.g., linearly scale lr.

For two GPU, you can just do (2).