-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathtrain.sh
42 lines (38 loc) · 1.11 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
#!/bin/bash
if [[ "$1" == "-h" || "$1" == "--help" ]]; then
echo 'Usage: bash '$(basename $0)' [DATASET="data/datasets/heridal_keras_retinanet_voc"] [EPOCHS=3] [BACKBONE="resnet152"]'
exit 0
fi
export WANDB_MODE="disabled"
export LC_ALL=C.UTF-8
export LANG=C.UTF-8
DATASET="${PWD}/data/datasets/heridal_keras_retinanet_voc"
EPOCHS=3
BACKBONE="resnet50"
DATASET="${1:-$DATASET}"
EPOCHS="${2:-$EPOCHS}"
BACKBONE="${3:-$BACKBONE}"
# use 5564 for real training (show all images per epoch), although it can take long time
STEPS=3
python3 keras_retinanet/keras_retinanet/bin/train.py \
--gpu 0 \
--random_transform=true \
--anchor_scale=0.965 \
--config=$PWD/keras_retinanet/config.ini \
--early_stop_patience=10 \
--image_max_side=1000 \
--image_min_side=750 \
--lr=0.00002196 \
--seed=26203 \
--reduce_lr_factor=0.33 \
--reduce_lr_patience=4 \
--no_resize=true \
--compute_val_loss \
--steps=$STEPS \
--epochs=$EPOCHS \
--backbone=$BACKBONE \
--group=retinanet-train-model-selection \
--tags=model-selection \
--snapshot_interval=2 \
pascal \
$DATASET