a b/Object-Detection/obj_det_train_py.sh
1
#!/usr/bin/env bash
2
3
echo ">>>>    "on machine: $(hostnamectl)
4
5
# === for models to work ===
6
# echo ">>>>    "activate protoc and export PYTHONPATH
7
8
cd ./research/
9
10
pwd
11
12
# From tensorflow/models/research/
13
# protoc object_detection/protos/*.proto --python_out=.
14
# From tensorflow/models/research/
15
# export PYTHONPATH=$PYTHONPATH:`pwd`:`pwd`/slim
16
echo ">>>>    "$PYTHONPATH
17
18
# then cd to obj-det folder
19
echo ">>>>    "cd to obj-det folder
20
21
cd ./object_detection/
22
23
pwd
24
25
echo first clean up training dir
26
27
rm training/pipeline.config
28
rm training/checkpoint
29
rm training/model.ckpt*
30
rm training/graph.pbtxt
31
rm training/events.out.*
32
33
echo ">>>>    "run the python script for train obj-det model
34
35
# Resnet
36
PRE_TRAINED_MODEL_CONFIG="faster_rcnn_resnet101_coco_baseON_2018_07_13_sag.config"
37
38
python3 legacy/train.py \
39
  --logtostderr \
40
  --train_dir=training/ \
41
  --pipeline_config_path=$PRE_TRAINED_MODEL_CONFIG