Language:
🇺🇸
🇨🇳
«MultiGrain» re-implements the paper MultiGrain: a unified image embedding for classes and instances
MultiGrain provides a unified framework to simultaneously train classification and retrieval tasks. In addition, it also provides source code implementation - facebookresearch/multigrain. This warehouse is modified on the original basis to deepen the understanding and use of the MultiGrain framework.
...
cd multigrain
export PYTHONPATH=.
- Base Operation
# One-GPU
python3 train.py --model resnet50 --lr 1e-2 --data-path /data/imagenet/ --output-dir ./outputs --ra-reps 1 --batch-size 128 --epochs 120
# Multi-GPU
torchrun --nproc_per_node=8 train.py --model resnet50 --lr 1e-2 --data-path /data/imagenet/ --output-dir ./outputs --ra-reps 1 --batch-size 128 --epochs 120
- Use DistributedSampler (Multi-GPU)
torchrun --nproc_per_node=8 train.py --model resnet50 --lr 0.2 --data-path /data/imagenet/ --output-dir ./outputs --batch-size 256 --epochs 120 --classify-weight 0.5 --pooling-exponent 3 --ra-reps 3 --amp --lr-warmup-epochs 5 --lr-warmup-method linear
Epoch: [117] Acc@1 75.816 Acc@5 92.600
- Use RASampler (Multi-GPU)
torchrun --nproc_per_node=8 train.py --model resnet50 --lr 0.2 --data-path /data/imagenet/ --output-dir ./outputs --batch-size 256 --epochs 120 --classify-weight 0.5 --pooling-exponent 3 --ra-sampler --ra-reps 3 --amp --lr-warmup-epochs 5 --lr-warmup-method linear
Epoch: [114] Acc@1 75.634 Acc@5 92.686
- zhujian - Initial work - zjykzj
@ARTICLE{2019arXivMultiGrain,
author = {Berman, Maxim and J{\'e}gou, Herv{\'e} and Vedaldi Andrea and
Kokkinos, Iasonas and Douze, Matthijs},
title = "{{MultiGrain}: a unified image embedding for classes and instances}",
journal = {arXiv e-prints},
year = "2019",
month = "Feb",
}
Anyone's participation is welcome! Open an issue or submit PRs.
Small note:
- Git submission specifications should be complied with Conventional Commits
- If versioned, please conform to the Semantic Versioning 2.0.0 specification
- If editing the README, please conform to the standard-readme specification.
Apache License 2.0 © 2022 zjykzj