Error while reading DeepLabv3+ tensorflow model in OpenCV
I am getting the following error while trying to import the model for DeepLabv3+ semantic segmentation ( https://github.com/tensorflow/models/... ) in OpenCV using readNetFromTensorflow.
libc++abi.dylib: terminating with uncaught exception of type cv::Exception: OpenCV(3.4.3) /Users/snayak/opencv/opencv-3.4.3/modules/dnn/src/tensorflow/tf_importer.cpp:1145: error: (-213:The function/feature is not implemented) Unsupported squeeze configuration in function 'populateNet'
I used the frozen_inference_graph.pb file which is given at
http://download.tensorflow.org/models...
The tensorboard model graph is attached here.
Any help in resolving this would be greatly appreciated. Thanks !
cc @dkurt ...
@berak, yeah, thank you. I just wanted to reproduce it today.
The model is full of support nodes such Assert. One of the solutions is to generate a text graph removing all non-deep learning nodes. You may do it by writeTextGraph excluding all the
Const
nodes or by script (in example from https://github.com/opencv/opencv/issu...).@dkurt, I did that based on the script you provided above, but I still get the same error, this time initiated at line 1153 of tf_importer.cpp:
libc++abi.dylib: terminating with uncaught exception of type cv::Exception: OpenCV(3.4.3) /Users/snayak/opencv/opencv-3.4.3/modules/dnn/src/tensorflow/tf_importer.cpp:1153: error: (-213:The function/feature is not implemented) Unsupported squeeze configuration in function 'populateNet'
In the .pbtxt file, the squeeze_dims attribute in the Squeeze node looks like this: attr {key: "squeeze_dims" value {list {i: 0}}} This doesn't satisfy the conditions in tf_importer.cpp(lines 1143) under type == "Squeeze"(when using .pb file only with readNetFromTensorflow). When using the new .pbtxt file, datalayout conditions are not satisfied(1153).