-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathtrain.sh
53 lines (41 loc) · 1.56 KB
/
train.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
#!/bin/sh
set -x
export PYTHONPATH="$PYTHONPATH:`pwd`"
mkdir -p "log"
mkdir -p "saved_results"
# Train for only 10,000 steps.
# The results we put in the challenge trained for 200,000 steps.
#number_of_steps=200000
number_of_steps=10000
name="vse++"
#name="advise.densecap_0.1.symbol_0.1"
#name="advise.kb"
export CUDA_VISIBLE_DEVICES=0
python "train/train.py" \
--pipeline_proto="configs/${name}.pbtxt" \
--train_log_dir="logs/${name}/train" \
--number_of_steps="${number_of_steps}" \
> "log/${name}.train.log" 2>&1 &
# Also specify --restore_from if fine-tune the knowledge branch (advise.kb).
# --restore_from="logs/advise.densecap_0.1.symbol_0.1/saved_ckpts/model.ckpt-10000" \
python "train/eval.py" \
--pipeline_proto="configs/${name}.pbtxt" \
--action_reason_annot_path="data/train/QA_Combined_Action_Reason_train.json" \
--train_log_dir="logs/${name}/train" \
--eval_log_dir="logs/${name}/eval" \
--saved_ckpt_dir="logs/${name}/saved_ckpts" \
--continuous_evaluation="true" \
--number_of_steps="${number_of_steps}" \
> "log/${name}.eval.log" 2>&1 &
wait
#########################################################
# Export the results for testing.
#########################################################
python "train/eval.py" \
--pipeline_proto="configs/${name}_test.pbtxt" \
--action_reason_annot_path="data/test/QA_Combined_Action_Reason_test.json" \
--saved_ckpt_dir="logs/${name}/saved_ckpts" \
--continuous_evaluation="false" \
--final_results_path="saved_results/${name}.json" \
|| exit -1
exit 0