dnn模块使用pb生成pbtxt文件,生成错误AssertionError
tensorflow吧
全部回复
仅看楼主
level 1
YourZhou66 楼主
最近在学习使用tensorflow object detection api ,使用github的预训练模型ssd_mobilenet_v2_coco训练自己的数据集,得到PB模型后,PB模型通过检测时可以使用的,想通过opencv dnn模块tf_text_graph_ssd.py生成对应的pbtxt文件,生成错误,结果如下,希望能给点帮助
D:\opencv-4.1.0\opencv\sources\samples\dnn>python tf_text_graph_ssd.py --input D:\people_detection\test\frozen_inference_graph.pb --output D:\people_detection\test\graph.pbtxt --config D:\people_detection\test\pipeline.config
Scale: [0.200000-0.950000]
Aspect ratios: [1.0, 2.0, 0.5, 3.0, 0.33329999446868896]
Reduce boxes in the lowest layer: True
Number of classes: 1
Number of layers: 6
box predictor: convolutional
Input image size: 300x300
Traceback (most recent call last):
File "tf_text_graph_ssd.py", line 367, in <module>
createSSDGraph(args.input, args.config, args.output)
File "tf_text_graph_ssd.py", line 232, in createSSDGraph
assert(graph_def.node[0].op == 'Placeholder')
AssertionError
试验用ssd_mobilenet_v2_coco自带的PB模型文件通过tf_text_graph_ssd.py生成pbtxt文件是可以的,成功结果是这样
D:\opencv-4.1.0\opencv\sources\samples\dnn>python tf_text_graph_ssd.py --input D:\tensorflow\ssd_mobilenet_v2_coco_2018_03_29\frozen_inference_graph.pb --output D:\tensorflow\ssd_mobilenet_v2_coco_2018_03_29\graph.pbtxt --config D:\tensorflow\ssd_mobilenet_v2_coco_2018_03_29\pipeline.config
Scale: [0.200000-0.950000]
Aspect ratios: [1.0, 2.0, 0.5, 3.0, 0.333299994469]
Reduce boxes in the lowest layer: True
Number of classes: 90
Number of layers: 6
box predictor: convolutional
Input image size: 300x300
问题困扰了挺久的,不同如何解决这个错误
Traceback (most recent call last):
File "tf_text_graph_ssd.py", line 367, in <module>
createSSDGraph(args.input, args.config, args.output)
File "tf_text_graph_ssd.py", line 232, in createSSDGraph
assert(graph_def.node[0].op == 'Placeholder')
AssertionError
2019年05月11日 07点05分 1
level 1
你好 我再tensorflow吧和opencv吧看到了你的提问,我也遇到这个问题了请问你解决了吗
2019年05月14日 07点05分 2
1