I have created a custom object detection ssd mobilenet model using Tensorflow 2. I have followed the following steps https://github.com/abhimanyu1990/SSD-Mobilenet-Custom-Object-Detector-Model-using-Tensorflow-2. The model is working fine with Tensorflow 2.
As we need to create text graph representation of the frozen model to use with opencv, I followed this link https://github.com/opencv/opencv/wiki/TensorFlow-Object-Detection-API and used tf_text_graph_ssd.py
to generate the config file so that I can use it with OpenCV. I am getting following error while running this script
`
Traceback (most recent call last):
File "/home/phoenix/Documents/repos/python/tensorflow_model/tf_text_graph_common.py", line 313, in writeTextGraph
cv.dnn.writeTextGraph(modelPath, outputPath)
cv2.error: OpenCV(4.4.0) /tmp/pip-req-build-6amqbhlx/opencv/modules/dnn/src/tensorflow/tf_io.cpp:42: error: (-2:Unspecified error) FAILED: ReadProtoFromBinaryFile(param_file, param). Failed to parse GraphDef file: exported-model/mobile-model/saved_model/saved_model.pb in function 'ReadTFNetParamsFromBinaryFileOrDie'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "tf_text_graph_ssd.py", line 405, in <module>
createSSDGraph(args.input, args.config, args.output)
File "tf_text_graph_ssd.py", line 128, in createSSDGraph
writeTextGraph(modelPath, outputPath, outNames)
File "/home/phoenix/Documents/repos/python/tensorflow_model/tf_text_graph_common.py", line 316, in writeTextGraph
from tensorflow.tools.graph_transforms import TransformGraph
ModuleNotFoundError: No module named 'tensorflow.tools.graph_transforms'
Thank you!