"Const kernel input not found" error when trying to load faster_rcnn models into OpenCV

asked 2018-06-27 11:58:01 -0600

updated 2018-06-27 12:02:20 -0600

berak gravatar image

System information (version)

OpenCV => 3.4.1 Operating System / Platform => Windows 64 Bit Compiler => Visual Studio 15 2017 Win64

Detailed description

I have been working with the tensorflow object detection API recently, and am trying to load faster_rcnn models into OpenCV using Visual Studio. However, whenever I attempt to do this, I encounter the following error:

OpenCV(3.4.1-dev) Error: Unspecified error (Const kernel input not found) in cv::dnn::experimental_dnn_v4::'anonymous-namespace'::TFImporter::getConstBlob, file d:\externallibraries\opencv\opencv-3.4\modules\dnn\src\tensorflow\tf_importer.cpp, line 484

I am using tf_text_graph_faster_rcnn to convert frozen_inference_graph.pb files to config.pbtxt files. All the models I have been using I have gotten from the tensorflow detection model zoo, and I recieve the same error regardless of whether I use a model trained on my own data or use the frozen_inference_graph.pb file in the downloaded tar.gz file. I have also tried using object_detection.cpp to load and test the model in OpenCV, as well a custom test script. Both result in the above error.

Steps to reproduce

-Download any faster_rcnn model from https://github.com/tensorflow/models/... (tensorflow detection model zoo, I've tried most of them) -Extract files and run tf_text_graph_faster_rcnn.py on the frozen_inference_graph.py file -Run object_detection.cpp on any image, using frozen_inference_graph.pb and the generated .pbtxt file as inputs

Doing this results in the error for me. If more information is needed, please let me know.

Thanks!

edit retag flag offensive close merge delete