-
Notifications
You must be signed in to change notification settings - Fork 53
/
reproduce.sh
73 lines (61 loc) · 2.59 KB
/
reproduce.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/bin/bash
DEVICE_ID=0,1,2,3
TTA=4
MODEL_NAMES=(
model_a_00
model_a_02
model_b_00
model_b_01
model_b_02
model_b_03
model_b_04
model_b_05
model_b_06
model_b_07
model_b_08
)
##################################################################################
# inference all models
##################################################################################
for MODEL_NAME in ${MODEL_NAMES[@]}; do
CONFIG=configs/$MODEL_NAME.yaml
CHECKPOINT=checkpoints/$MODEL_NAME.pth
OUTPUT_PATH=inference_results/$MODEL_NAME
CUDA_VISIBLE_DEVICES=$DEVICE_ID python run.py inference with $CONFIG evaluation.batch_size=2 inference.output_path=$OUTPUT_PATH transform.params.tta=$TTA inference.split=dev checkpoint=$CHECKPOINT -f
CUDA_VISIBLE_DEVICES=$DEVICE_ID python run.py inference with $CONFIG evaluation.batch_size=2 inference.output_path=$OUTPUT_PATH transform.params.tta=$TTA inference.split=test_dev checkpoint=$CHECKPOINT -f
CUDA_VISIBLE_DEVICES=$DEVICE_ID python run.py inference with $CONFIG evaluation.batch_size=2 inference.output_path=$OUTPUT_PATH transform.params.tta=$TTA inference.split=test checkpoint=$CHECKPOINT -f
done
# The result of model_a_01 was generated with no tta because of just my fault.
TTA=1
MODEL_NAME=model_a_01
CONFIG=configs/$MODEL_NAME.yaml
CHECKPOINT=checkpoints/$MODEL_NAME.pth
OUTPUT_PATH=inference_results/$MODEL_NAME
CUDA_VISIBLE_DEVICES=$DEVICE_ID python run.py inference with $CONFIG evaluation.batch_size=2 inference.output_path=$OUTPUT_PATH transform.params.tta=$TTA inference.split=dev checkpoint=$CHECKPOINT -f
CUDA_VISIBLE_DEVICES=$DEVICE_ID python run.py inference with $CONFIG evaluation.batch_size=2 inference.output_path=$OUTPUT_PATH transform.params.tta=$TTA inference.split=test_dev checkpoint=$CHECKPOINT -f
CUDA_VISIBLE_DEVICES=$DEVICE_ID python run.py inference with $CONFIG evaluation.batch_size=2 inference.output_path=$OUTPUT_PATH transform.params.tta=$TTA inference.split=test checkpoint=$CHECKPOINT -f
##################################################################################
# evaluate & inference
##################################################################################
MODEL_NAMES=(
model_a_00
model_a_01
model_a_02
model_b_00
model_b_01
model_b_02
model_b_03
model_b_04
model_b_05
model_b_06
model_b_07
model_b_08
)
OUTPUTS=
for MODEL_NAME in ${MODEL_NAMES[@]}; do
OUTPUT_PATH=inference_results/$MODEL_NAME
OUTPUTS=$OUTPUTS,$OUTPUT_PATH
done
OUTPUTS=${OUTPUTS:1}
python tools/evaluate.py --input_dir $OUTPUTS
python tools/make_submission.py --input_dir $OUTPUTS --output=submissions/reproduce.csv