Step 1
I have downloaded the PASCAL VOC dataset (the VOCtrainval_11-May-2012.tar
file).
Then I extracted the archive’s contents.
Step 2
Then I have generated TFRecord files:
python object_detection/dataset_tools/create_pascal_tf_record.py \
--label_map_path=object_detection/data/pascal_label_map.pbtxt \
--data_dir=C:/work/ai/sandboxes/2019-04-25/VOCdevkit --year=VOC2012 --set=train \
--output_path=C:/work/ai/sandboxes/2019-04-25/pascal_train.record
python object_detection/dataset_tools/create_pascal_tf_record.py \
--label_map_path=object_detection/data/pascal_label_map.pbtxt \
--data_dir=C:/work/ai/sandboxes/2019-04-25/VOCdevkit --year=VOC2012 --set=val \
--output_path=C:/work/ai/sandboxes/2019-04-25/pascal_val.record
Step 3
Then I have created a pipeline configuration file.
I have used the faster_rcnn_resnet101_voc07.config
sample as a base, and modified some parts of it:
-
I have removed the
fine_tune_checkpoint
andfrom_detection_checkpoint
parameters. -
I have replaced the
PATH_TO_BE_CONFIGURED
placeholder with actual paths:
Step 4
Then I have run the training:
python object_detection/model_main.py \
--pipeline_config_path=C:/work/ai/sandboxes/2019-04-25/code/_my/faster_rcnn_resnet101_voc07.config \
--model_dir=C:/work/ai/sandboxes/2019-04-25/model \
--num_train_steps=50000 \
--sample_1_of_n_eval_examples=1 \
--alsologtostderr
Step 4.1
Also, I have run TensorBoard in parallel to monitor the training process.
tensorboard --logdir=C:/work/ai/sandboxes/2019-04-25/model