Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
shuuchen authored Aug 26, 2021
1 parent 5c5f10b commit b4591b9
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ An unofficial PyTorch implementation of DetCo [paper](https://arxiv.org/pdf/2102

This implementation is based on the official implementation of [MoCo](https://github.com/facebookresearch/moco) and [PyTorch resnet code](https://github.com/pytorch/vision/blob/master/torchvision/models/resnet.py). Though list is mentioned in original paper, this implementation use pure tensors without list, which enables parallel computing.


## Requirements
```
pip install -r requirements.txt
Expand All @@ -14,16 +15,20 @@ pip install -r requirements.txt
- Please refer to [main_decto.py](https://github.com/shuuchen/DetCo.pytorch/blob/main/main_decto.py):

## Unsupervised training
- This implementation reserved original moco implementation as much as possible. Therefore the command line for unsupervised training is also similar to that of [moco](https://github.com/facebookresearch/moco#unsupervised-training). You can train like:
```python
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
```
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:
- [number of GPUs to use](https://github.com/shuuchen/DetCo.pytorch/blob/main/main_detco.py#L124)
- [master GPU number](https://github.com/shuuchen/DetCo.pytorch/blob/main/main_detco.py#L136)

This implementation reserved original moco implementation as much as possible. Therefore the command line for unsupervised training is also similar to that of [moco](https://github.com/facebookresearch/moco#unsupervised-training). You can train like:
- ```python
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
Expand Down

0 comments on commit b4591b9

Please sign in to comment.