Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Unable to read TensorFlow trained model into OpenCV 3.4.1

I am trying to read the TensorFlow trained model in OpenCV, I have downloaded ssd_inception_v2_coco and ssd_mobilenet_v1_coco from here model while reading the Net like this:

String basePath = "/home/adil/Desktop/models/ssd_mobilenet_v1_coco_2017_11_17/";
String model = basePath + "frozen_inference_graph.pb";
Net net = Dnn.readNetFromTensorflow(model);

But it throws this error:

tf_importer.cpp:1582: error: (-2) Unknown layer type Cast in op ToFloat in function populateNet

Why it should throw the error, is there anything else to configure? If yes, then how can be done to successfully read and use the TF trained model into OpenCV application.

Thanks!!