Ask Your Question

Revision history [back]

Can't create layer "leaky_0/LeakyRelu" of type "LeakyRelu" in function 'getLayerInstance'

I have converted a custom yolov3 model from keras .h5 to tensorflow .pb model. Now when load and run the converted model using opencv dnn module during forward pass I get the following error.

detections = cvNet.forward() cv2.error: OpenCV(4.0.0) /io/opencv/modules/dnn/src/dnn.cpp:413: error: (-2:Unspecified error) Can't create layer "leaky_0/LeakyRelu" of type "LeakyRelu" in function 'getLayerInstance'

I have changed opencv versions but it does not change anything.

Also I have tried yolo darknet pre-trained model that has leakyrelu as activation using readNetfromDarknet and there is no error in this case which makes me think it should not be related to leakyRelu specifically but something related to tensorflow support in opencv dnn.

I searched it on google and it returned with zero response. Can anyone tell me what I can do to remove this error ?

click to hide/show revision 2
retagged

updated 2019-04-04 05:57:59 -0600

berak gravatar image

Can't create layer "leaky_0/LeakyRelu" of type "LeakyRelu" in function 'getLayerInstance'

I have converted a custom yolov3 model from keras .h5 to tensorflow .pb model. Now when load and run the converted model using opencv dnn module during forward pass I get the following error.

detections = cvNet.forward() cv2.error: OpenCV(4.0.0) /io/opencv/modules/dnn/src/dnn.cpp:413: error: (-2:Unspecified error) Can't create layer "leaky_0/LeakyRelu" of type "LeakyRelu" in function 'getLayerInstance'

I have changed opencv versions but it does not change anything.

Also I have tried yolo darknet pre-trained model that has leakyrelu as activation using readNetfromDarknet and there is no error in this case which makes me think it should not be related to leakyRelu specifically but something related to tensorflow support in opencv dnn.

I searched it on google and it returned with zero response. Can anyone tell me what I can do to remove this error ?