-
Notifications
You must be signed in to change notification settings - Fork 1
/
run.sh
executable file
·40 lines (34 loc) · 1.26 KB
/
run.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/usr/bin/env bash
export DATA=${DATA:-data_info.yml}
DATASET=${DATASET:-CUB200}
MODEL_TYPE=${MODEL_TYPE:-cvmodelz.InceptionV3}
# IT HAS TO BE 1! Otherwise kMeans in the child processes does nothing
export OMP_NUM_THREADS=1
_now=$(date +%Y-%m-%d-%H.%M.%S.%N)
OUTPUT_PREFIX=${OUTPUT_PREFIX:-"outputs"}
OUTPUT_DIR=${OUTPUT_DIR:-${OUTPUT_PREFIX}/${DATASET}/${MODEL_TYPE}/${_now}}
OPTS="${OPTS} --model_type ${MODEL_TYPE}"
OPTS="${OPTS} --weights $(realpath ${WEIGHTS:-models/ft_${DATASET}_inception.npz})"
OPTS="${OPTS} --pretrained_on ${PRETRAIN:-inat}"
OPTS="${OPTS} --prepare_type ${PREPARE_TYPE:-model}"
OPTS="${OPTS} --input_size ${INPUT_SIZE:-299}"
OPTS="${OPTS} --label_shift ${LABEL_SHIFT:-1}"
OPTS="${OPTS} --n_jobs ${N_JOBS:-6}"
OPTS="${OPTS} --gpu ${GPU:-0}"
OPTS="${OPTS} --center_crop_on_val"
# OPTS="${OPTS} --no_dump"
OPTS="${OPTS} --output ${OUTPUT_DIR}"
VACUUM=${VACUUM:-1}
if [[ $VACUUM == 1 ]]; then
echo "=!=!=!= On error, removing folder ${OUTPUT_DIR} =!=!=!="
OPTS="${OPTS} --vacuum"
fi
############################################
### Adding cluster_parts submodule
############################################
export PYTHONPATH="${PYTHONPATH}:src/cluster_parts"
${PYTHON:-python} src/main.py \
${DATA} \
${DATASET} \
GLOBAL \
$OPTS $@