mmselfsup/benchmarks/dist_test_svm_epoch.sh

29 lines
773 B
Bash
Raw Normal View History

2020-06-17 01:31:59 +08:00
#!/bin/bash
set -e
set -x
CFG=$1
EPOCH=$2
FEAT_LIST=$3 # e.g.: "feat5", "feat4 feat5". If leave empty, the default is "feat5"
GPUS=${4:-8}
WORK_DIR=$(echo ${CFG%.*} | sed -e "s/configs/work_dirs/g")/
2020-06-18 00:37:23 +08:00
if [ "$CFG" == "" ] || [ "$EPOCH" == "" ]; then
echo "ERROR: Missing arguments."
exit
fi
2020-06-17 01:31:59 +08:00
if [ ! -f $WORK_DIR/epoch_${EPOCH}.pth ]; then
echo "ERROR: File not exist: $WORK_DIR/epoch_${EPOCH}.pth"
exit
fi
2020-06-19 17:04:59 +08:00
mkdir -p $WORK_DIR/logs
echo "Testing checkpoint: $WORK_DIR/epoch_${EPOCH}.pth" 2>&1 | tee -a $WORK_DIR/logs/eval_svm.log
bash tools/dist_extract.sh $CFG $GPUS $WORK_DIR --checkpoint $WORK_DIR/epoch_${EPOCH}.pth
2020-06-17 01:31:59 +08:00
2020-06-19 20:40:42 +08:00
bash benchmarks/svm_tools/eval_svm_full.sh $WORK_DIR "$FEAT_LIST"
2020-06-17 01:31:59 +08:00
2020-06-19 20:40:42 +08:00
bash benchmarks/svm_tools/eval_svm_lowshot.sh $WORK_DIR "$FEAT_LIST"