训练 TensorFlow 对象检测时出现 ValueError:"all elements of boxlists should be BoxList objects"
ValueError when training TensorFlow object detection: "all elements of boxlists should be BoxList objects"
我有一个只有 10 张碳酸饮料图像的数据集。这是因为我想先测试一下设置 TFRecords 和训练管道的过程,然后再花几个小时标记一堆照片。
我在 macOS 上使用 RectLabel 标记了图像。这是注释的示例
<annotation>
<folder>training</folder>
<filename>image1.jpg</filename>
<path>/Users/{my_username}/Desktop/models-master/object_detection/training/image1.jpg</path>
<size>
<width>225</width>
<height>225</height>
</size>
<segmented>0</segmented>
<object>
<name>sodacan</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>61</xmin>
<ymin>20</ymin>
<xmax>155</xmax>
<ymax>207</ymax>
</bndbox>
</object>
路径属性是我自己加的。我不知道我是否需要它,我只是在注释示例中看到它。
这是我的标签地图的样子:
item {
id: 1
name: 'sodacan'
}
我使用了 Dat Tran 的两个脚本来创建 TFRecords。它们可以在 this repo 中找到。首先我使用 'xml_to_csv.py' 然后我使用 'generate_tfrecord.py'.
我用的是eshirima写的配置文件,可以找到here,当然是按照我的数据结构配置的。
我运行模型文件夹中的训练脚本使用:
python object_detection/train.py \
--logtostderr \
--pipeline_config_path=object_detection/ts_configuration.config \
--train_dir=Users/{my_username}/Desktop/empty_folder
大约 20-30 秒后抛出此错误:
ValueError: all elements of boxlists should be BoxList objects
我已经尝试使用对象检测存储库上的教程来创建记录,我已经尝试使用其中一个示例配置,但我仍然遇到该错误。但是,如果我使用 object_detection 文件夹中示例文件夹中的 'faster_rcnn_inception_resnet_v2_atrous_pets' 配置,我会收到此错误:
ValueError: boxlist must be a BoxList
我不知道从这里可以做什么。任何帮助将不胜感激!
所以我想通了这个问题。
我完全忘记了我对 visualization_utils.py 脚本所做的修改,以提取更多信息。这显然也打破了训练。
我再次下载了模型库,重新开始整个过程,现在训练 运行!
我有一个只有 10 张碳酸饮料图像的数据集。这是因为我想先测试一下设置 TFRecords 和训练管道的过程,然后再花几个小时标记一堆照片。
我在 macOS 上使用 RectLabel 标记了图像。这是注释的示例
<annotation>
<folder>training</folder>
<filename>image1.jpg</filename>
<path>/Users/{my_username}/Desktop/models-master/object_detection/training/image1.jpg</path>
<size>
<width>225</width>
<height>225</height>
</size>
<segmented>0</segmented>
<object>
<name>sodacan</name>
<pose>Unspecified</pose>
<truncated>0</truncated>
<difficult>0</difficult>
<bndbox>
<xmin>61</xmin>
<ymin>20</ymin>
<xmax>155</xmax>
<ymax>207</ymax>
</bndbox>
</object>
路径属性是我自己加的。我不知道我是否需要它,我只是在注释示例中看到它。
这是我的标签地图的样子:
item {
id: 1
name: 'sodacan'
}
我使用了 Dat Tran 的两个脚本来创建 TFRecords。它们可以在 this repo 中找到。首先我使用 'xml_to_csv.py' 然后我使用 'generate_tfrecord.py'.
我用的是eshirima写的配置文件,可以找到here,当然是按照我的数据结构配置的。
我运行模型文件夹中的训练脚本使用:
python object_detection/train.py \
--logtostderr \
--pipeline_config_path=object_detection/ts_configuration.config \
--train_dir=Users/{my_username}/Desktop/empty_folder
大约 20-30 秒后抛出此错误:
ValueError: all elements of boxlists should be BoxList objects
我已经尝试使用对象检测存储库上的教程来创建记录,我已经尝试使用其中一个示例配置,但我仍然遇到该错误。但是,如果我使用 object_detection 文件夹中示例文件夹中的 'faster_rcnn_inception_resnet_v2_atrous_pets' 配置,我会收到此错误:
ValueError: boxlist must be a BoxList
我不知道从这里可以做什么。任何帮助将不胜感激!
所以我想通了这个问题。
我完全忘记了我对 visualization_utils.py 脚本所做的修改,以提取更多信息。这显然也打破了训练。
我再次下载了模型库,重新开始整个过程,现在训练 运行!