This is pytorch-self-supervised-learning repository.
Table of contents:
- tutorial
- experimental result
-
clone this repo.
git clone https://github.com/hankyul2/pytorch-ssl.git cd pytorch-ssl pip3 install requirements.txt
-
run following command.
- run following command.
-
run following command.
KNN classifier
# Single-GPU python3 valid.py -es imagenet1k_knn_224_v1 -ws dino_official # Multi-GPU torchrun --nproc_per_node=4 --master_port=12345 valid.py -es imagenet1k_knn_224_v1 -ws dino_official
FC classifier
# Single-GPU python3 valid.py -es imagenet1k_fc_224_v1 -ws dino_official # Multi-GPU torchrun --nproc_per_node=4 --master_port=12345 valid.py -es imagenet1k_fc_224_v1 -ws dino_official
Tips
- For large sized train dataset, we recommend to run multi-gpu command because, extracting whole features takes too much time in single gpu.
- If you have extracted features once, please specify the extracted feature path at
feature_path
inconfig/valid.json
. - If you don't specify weight settings (
-ws
), whole weight settings will be used in validation. - If you don't specify model name (
-m
), whole model inmodel_weight
will be used in validation.