This repository implenments MoCo v1 using Pytorch. This repository is only for learning purpose since I have only implemented the core idea of MoCo v1.
I have used the torchvision.datasets.Caltech256
dataset to train MoCo.
However, you might encounter urllib.error.HTTPError: HTTP Error 404: Not Found
error when trying to use download=True
to download it.
It is because that the url of Caltech256
dataset has changed, the older torchvision
version (in my case, 0.8.2
) has trouble downloading the dataset.
It at least requires 2 gpus to run, since the Shuffle BN operation introduced in the paper requires at least two GPUs to run.
python -m torch.distributed.launch --nproc_per_node=2 train_moco.py