opencv_contrib: Unknown layer type error in tf_importer.cpp while running import->populateNet(Net)

System information (version)
  • OpenCV => 3.2 (1aeeee0057faedbf6c693ce99ab36b12b07fc6d6)
  • Operating System / Platform => Windows 64 Bit
  • Compiler => Visual Studio 2015
Detailed description

I am trying to run the tf_inception.cpp example. The compilation is successful, but it gives a run-time error. The error happens at line 83 calling: importer->populateNet(net);

populateNet goes through all layers in a for loop at line 508 of the tf_importer.cpp. However, both name and type of the layer # 1 of the tensorflow_inception_graph.pb (when li = 1), is DecodeJpeg, which does not match any case in the loop and results in the error in line 729:

...
else
{
     printLayerAttr(layer);
     CV_Error_(Error::StsError, ("Unknown layer type %s in op %s", type.c_str(), name.c_str()));
}

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 59 (28 by maintainers)

Most upvoted comments

Hello, I have encountered the same issue as described here. We are using the inception model, retrained on our images as shown in this tutorial: https://www.tensorflow.org/tutorials/image_retraining. The suggested freeze_graph.py script did not solve the problem. It would be useful if the dnn module could handle models created this way as the official Tensorflow tutorials will surely be an entry point for many programmers.

@BAILOOL, Conv2DBackpropInput was merged recently with https://github.com/opencv/opencv/pull/9349 with a test case https://github.com/opencv/opencv_extra/blob/master/testdata/dnn/tensorflow/generate_tf_models.py#L111. May I ask you to update source code and try again?