shuuchen / DetCo.pytorch

A PyTorch implementation of DetCo https://arxiv.org/pdf/2102.04803.pdf

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DetCo.pytorch

An unofficial PyTorch implementation of DetCo paper. Official implementation can be found here.

スクリーンショット 2021-03-30 11 39 04

This implementation is based on the official implementation of MoCo and PyTorch resnet code. Though list is mentioned in original paper, this implementation use pure tensors without list, which enables parallel computing.

Requirements

pip install -r requirements.txt

Usage

Unsupervised training

As specified in the original paper, DetCo is trained with 8 GPUs with batch shuffling. However, sometimes you cannot use all the GPUs in an 8-GPU machine. I used half of them for training. If you also need to modify the number of GPUs like me, check the following two lines of code:

This implementation reserved original moco implementation as much as possible. Therefore the command line for unsupervised training is also similar to that of moco. You can train like:

  • python main_detco.py \
      -a resnet50 \
      --lr 0.015 \
      --batch-size 128 \
      --dist-url 'tcp://localhost:10001' --multiprocessing-distributed --world-size 1 --rank 0 \
      [your imagenet-folder with train and val folders] \
      --detco-t 0.2 --aug-plus --cos

TODO

  • object detection training & performance checking on certain datasets

References

About

A PyTorch implementation of DetCo https://arxiv.org/pdf/2102.04803.pdf

License:MIT License


Languages

Language:Python 100.0%