ZER-0-NE / EAST-Detector-for-text-detection-using-OpenCV

Text Detection from images using OpenCV
MIT License
108 stars 55 forks source link

east errors #3

Open SpringRainLu opened 4 years ago

SpringRainLu commented 4 years ago

i tried to run text detection.py based on my own east model, but it failed at ''outs = net.forward(outNames)'' cv2.error: OpenCV(4.1.1) .\opencv-python\opencv\modules\dnn\src\dnn.cpp:525: error: (-2:Unspecified error) Can't create layer "resnet_v1_50/conv1/BatchNorm/FusedBatchNormV3" of type "FusedBatchNormV3" in function 'cv::dnn::dnn4_v20190621::LayerData::getLayerInstance'

i saved my model in this:

output_graph = "frozen_east_model_02.pb" output_graph_def = tf.graph_util.convert_variables_to_constants(sess, sess.graph_def, ["feature_fusion/Conv_7/Sigmoid", "feature_fusion/concat_3"]) tf.train.write_graph(output_graph_def, ".", output_graph, as_text=False)

i have tried to modify model.py , nevertheless it did not work.

c1_1 = slim.conv2d(tf.concat([g[i-1], f[i]], axis=3), num_outputs[i], 1) pi2 = 0.5 np.pi angle_map = (slim.conv2d(g[3], 1, 1, activation_fn=tf.nn.sigmoid, normalizer_fn=None) - 0.5) pi2 # angle is between [-45, 45] F_geometry = tf.concat([geo_map, angle_map], axis=3)

but the official east model.pb worked, what i did wrong?

ZER-0-NE commented 3 years ago

Interesting use. But I think it won't work (at least directly) with your custom model. The error clearly states Can't create layer "resnet_v1_50/conv1/BatchNorm/FusedBatchNormV3" of type "FusedBatchNormV3" in function 'cv::dnn::dnn4_v20190621::LayerData::getLayerInstance'.

This issue has been up for a long time and I'd like to know if you've resolved this? @SpringRainLu . If so, please consider adding some additional information for future developers.

`