要运行的文件:models-master\research\object_detection\dataset_tools\create_pascal_tf_record.py
1、设置run edit configurations-->Script parameters:
--data_dir C:\Users\XX\Downloads\models-master\research\object_detection\voc\VOCdevkit --year VOC2012 --set=train --output_path=D:\voc\pascal_train.record
【注意】
a、四个参数:--data_dir:数据集所在那个路径 --output_path:指定输出的tfrecord文件的路径
b、如果是window系统,且数据集不在当前文件的相同目录下,参数的路径要写绝对路径
c、D:\voc 在D盘下创建voc文件夹
修改create_pascal_tf_record.py中的第49行:
flags.DEFINE_string('label_map_path',object_detection/data/pascal_label_map.pbtxt')
d、在object_detection文件夹下创建voc文件夹,并将下载的数据集VOCtrainval_11-May-2012.tar解压到当前文件夹中,
最终文件夹结构应为:
research/
object_detection/
voc/
VOCdevkit/
VOC2012/
JPEGImages/
2007_000027.jpg
2007_000032.jpg
......
Annotations/
2007_000027.xml
2007_000032.xml
.......
ImageSets
......
SegmentationClass
......
SegmentationObject
......