forked from nolanliou/mobile-deeplab-v3-plus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtrain_pascal_voc2012.sh
executable file
·46 lines (36 loc) · 1.36 KB
/
train_pascal_voc2012.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
#!/usr/bin/env bash
# Exit immediately if a command exits with a non-zero status.
set -e
export CUDA_VISIBLE_DEVICES=''
# Update PYTHONPATH.
export PYTHONPATH=$PYTHONPATH:`pwd`
MODEL_TYPE='deeplab-v3-plus'
PRETRAINED_MODEL_DIR='pretrained_model'
PRETRAINED_BACKBONE_MODEL_DIR='pretrained_backbone_model'
# Set up the working environment.
CURRENT_DIR=$(pwd)
WORK_DIR="${CURRENT_DIR}"
# Run model_test first to make sure the PYTHONPATH is correctly set.
# python "${WORK_DIR}"/deeplab_v3_plus_test.py -v
# Go to datasets folder and download PASCAL VOC 2012 segmentation dataset.
DATASET_DIR="datasets"
cd "${WORK_DIR}/${DATASET_DIR}"
#sh download_and_convert_voc2012.sh
# Go back to original directory.
cd "${CURRENT_DIR}"
# Set up the working directories.
PASCAL_FOLDER="pascal_voc2012"
EXP_FOLDER="exp"
TRAIN_LOGDIR="${WORK_DIR}/${DATASET_DIR}/${PASCAL_FOLDER}/${EXP_FOLDER}/${MODEL_TYPE}/train"
mkdir -p "${TRAIN_LOGDIR}"
PASCAL_DATASET="${WORK_DIR}/${DATASET_DIR}/${PASCAL_FOLDER}/tfrecord"
python run.py --dataset_dir="${PASCAL_DATASET}"\
--dataset_name="pascal_voc2012" \
--logdir="${TRAIN_LOGDIR}" \
--model_type="${MODEL_TYPE}" \
--base_learning_rate=0.007 \
--num_clones=1 \
--training_number_of_steps=40000 \
--pretrained_backbone_model_dir="${PRETRAINED_BACKBONE_MODEL_DIR}"
# --pretrained_model_dir="${PRETRAINED_MODEL_DIR}" \
# --training_number_of_steps=10