Ask Your Question
0

Can't create layer "conv1_relu/Minimum" of type "Minimum"

asked 2019-03-20 08:26:58 -0600

Raniem gravatar image

updated 2019-03-21 09:54:54 -0600

Hello All I am using opencv 4.0.0 on Windows 10 and Visual Studio 2017 I am trying to use a pretrained tensorflow model (MobileNet V2) using cv::dnn. It is a classification model, that has been fine tuned to classify the font of characters. it has been transformed using tensorflow transform_graph tool and is loading successfully using cv::dnn. However, calling the forward() is causing this error:

Can't create layer "conv1_relu/Minimum" of type "Minimum" in function 'cv::dnn::dnn4_v20180917::LayerData::getLayerInstance'

Any ideas please ?

The model is working just fine using tensorflow on python, so i think it is not an issue with the model it self P.S. I have uploaded the model pbtxt file, but you have to replace extension to .pbtxt (i had to make it as .png to be able to attach it)

Regards

edit retag flag offensive close merge delete

Comments

after transforming the model

-- what did you do, exactly ? what kind of model is it, a detection(SSD) or a classification one ? do you have a pbtxt ? may we see it ? where is the model ? can we look at it ?

berak gravatar imageberak ( 2019-03-20 08:51:16 -0600 )edit
1

Hi berak

Thanks for your comment sorry for not providing enough details It is a classification model, specifically MobileNetV2 fine tuned to classify the font of characters I have transformed the frozen model using tensorflow transfrom_graph However, After upgrading to opencv 4.0.0 I found out that the model is uploading even without the need to transform the graph Anyway the loading is working but forward() function is not, and is showing the error message as in my post. I will try to upload the pbtxt file for the model for further details if that helps. node { name: "conv1_relu/Minimum" op: "Minimum" input: "conv1_relu/Relu" input: "conv1_relu/Const" }

Raniem gravatar imageRaniem ( 2019-03-21 04:30:45 -0600 )edit

I have updated my post and attached the pbtxt ( had to change extention to .png in order to attach it)

Thanks for your comments and guidance

Raniem gravatar imageRaniem ( 2019-03-21 04:40:36 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2019-03-26 04:37:27 -0600

Raniem gravatar image

I found a work around this problem. as per suggested in this issue https://github.com/opencv/opencv/issu...

the minimum layer is not yet implemented but using RELU6 instead can work. I added a check in dnn.cpp file (createLayerInstance ) where it replaces the type of the layer with RELU6 when ever it is minimum and that worked for me with accepted model outcome. Hope this helps any one having the same problem.

Regards

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2019-03-20 08:26:58 -0600

Seen: 549 times

Last updated: Mar 26 '19