opencv: tf_text_graph_ssd.py have generated pbtxt file but load to test error

At this issue tf_text_graph_ssd.py #11560 https://github.com/opencv/opencv/issues/11560

#11560 (comment)

@dkurt When I use your code, I can successfully generate pbtxt file, but when I use opencv to call it the following error occurs,

[libprotobuf ERROR c:\build\master_winpack-build-win64-vc15\opencv\3rdparty\protobuf\src\google\protobuf\text_format.cc:288] Error parsing text-format opencv_tensorflow.GraphDef: 45167:5: Unknown enumeration value of “20” for field “type”. OpenCV: terminate handler is called! The last OpenCV error is: OpenCV(4.0.0) Error: Unspecified error (FAILED: ReadProtoFromTextFile(param_file, param). Failed to parse GraphDef file: ./model_fpn/graph.pbtxt) in cv::dnn::ReadTFNetParamsFromTextFileOrDie, file c:\build\master_winpack-build-win64-vc15\opencv\modules\dnn\src\tensorflow\tf_io.cpp, line 54

String weights = "./model_fpn/frozen_inference_graph.pb"; String prototxt = "./model_fpn/graph.pbtxt"; dnn::Net net = cv::dnn::readNetFromTensorflow(weights, prototxt);

Please help me, thanks

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 17 (8 by maintainers)

Most upvoted comments

@stq054188,

By the way, I can use my pb file get right result, thanks. @dkurt

Am I right that there is no problem anymore? If so, please close an issue.

@dkurt I am Sorry, I mean that my Pb file can only run normally under Python tensorflow, but the OpenCV DNN module needs pbtxt configuration file. I generated the pbtxt file, but I met above error when using OpenCV DNN to read it.