Hello everyone,
I would like to use the OpenCV DNN (C++) module to make predictions using a pre-trained TensorFlow 2.x object detection model (Mask R-CNN Inception ResNet V2 1024x1024). I have already adapted and retrained the model with Python and TesorFlow for my own input images and can also run the inference e.g. on a single test image. So everything seems to be working on the TensorFlow side.
Now I want to port this model to OpenCV and run the inference using the DNN module.
Since I used TensorFlow 2.x, which no longer supports the “frozen graph format” needed for the DNN module to work, I have to convert Tensorflow’s “saved model format” into the “frozen graph format”.
But now I fail at creating the “config file” (often also refered to as graph.pbtxt file), which I have to pass to the readNetFromTensorflow(const String &model, const String &config = String()) method.
The Python script that is supposed to create this file for me (tf_text_graph_mask_rcnn.py) fails with the following error message:
File “tf_text_graph_mask_rcnn.py”, line 41, in .
features_stride = float(config[‘feature_extractor’][0][‘first_stage_features_stride’][0])
KeyError: ‘first_stage_features_stride’
Can anyone help me here, has anyone had similar problems ?
Thanks,
Jonas