Ask Your Question

Revision history [back]

Error while running converted .h5 to .pb graph with OpenCV's dnn module

I have converted a custom trained keras model's .h5 file to .pb file. I have been trying to run the model using OpenCV's dnn module. But I am getting following mentioned error while inferencing.

Traceback (most recent call last): File "opencv_dnn.py", line 14, in networkOutput = tensorflowNet.forward() cv2.error: OpenCV(4.1.0) C:\projects\opencv-python\opencv\modules\dnn\src\dnn.cpp:524: error: (-2:Unspecified error) Can't create layer "leaky_0/LeakyRelu" of type "LeakyRelu" in function 'cv::dnn::dnn4_v20190122::LayerData::getLayerInstance'

How to run the model successfully?