Yixiao Fang b6585cc1f1
[Fix] Fix knn multi-gpu bug (#634)
* 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
2022-12-23 11:45:48 +08:00

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}