mirror of
https://github.com/open-mmlab/mmselfsup.git
synced 2025-06-03 14:59:38 +08:00
* update knn * update * fix bugs of knn * update entrance scripts * update configs and related codes * update sampler config * remove redundance * update * update docs * fix lint * update logic of loading ckpt
22 lines
533 B
Bash
22 lines
533 B
Bash
#!/usr/bin/env bash
|
|
|
|
set -e
|
|
set -x
|
|
|
|
CFG=$1
|
|
PRETRAIN=$2 # pretrained model
|
|
PY_ARGS=${@:3}
|
|
GPUS=${GPUS:-8}
|
|
PORT=${PORT:-29500}
|
|
|
|
PYTHONPATH="$(dirname $0)/..":$PYTHONPATH \
|
|
python -m torch.distributed.launch \
|
|
--nproc_per_node=$GPUS \
|
|
--master_port=$PORT \
|
|
tools/benchmarks/classification/knn_imagenet/test_knn.py $CFG \
|
|
--launcher="pytorch" \
|
|
--cfg-options model.backbone.init_cfg.type=Pretrained \
|
|
model.backbone.init_cfg.checkpoint=$PRETRAIN \
|
|
model.backbone.init_cfg.prefix='backbone.' \
|
|
${PY_ARGS}
|