Tensorflow对象检测 - 自己的类推断图训练/导出错误(张量形状)

时间:2018-05-23 17:23:19

标签: python tensorflow object-detection

我是tensorflow和对象检测的新手,我正在尝试创建自己来检测11个类。我试图使用下面的链接制作我自己的物体探测器。

https://github.com/tensorflow/models/tree/master/research/object_detection https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/detection_model_zoo.md

我有自己的带有11个类的label_map.pbtxt文件。

如果我更改了pipeline.config文件中的num_classes = 11,我已经能够训练更快的rcnn resnet模型,但是当我尝试使用export_inference_graph.py导出模型时,我收到一个错误:

InvalidArgumentError (see above for traceback): Assign requires shapes of both tensors to match. lhs shape= [12] rhs shape= [91]

但是,当我在pipeline.config文件中更改num_classes = 90时,我可以进行训练和导出。

我不确定我是否误解了某些东西,或者我不应该实际更改pipeline.config文件中的num_classes。

1 个答案:

答案 0 :(得分:0)

config和pbtxt文件中的类数应该匹配。可能这是错误的原因

CONFIG文件

模型{   ssd {     num_classes:11 .... ... }

PBTXT文件:也应该有11个条目

项目{   id:1   名字:'阿比西尼亚' }

项目{   id:2   姓名:' american_bulldog' }

项目{   id:3   名称:' american_pit_bull_terrier' } ... 项目{   id:11   名称:' american_pit_bull_terrier' }

相关问题