keras_to_tensorflow icon indicating copy to clipboard operation
keras_to_tensorflow copied to clipboard

Can not load TF model after converting

Open Walid-Ahmed opened this issue 6 years ago • 2 comments

Hi All I converted the model successfully and without any error message, I also created the pbtxt file. However when I try to load the model using OpenCV I am getting the following error:-

tensorflowNet = cv2.dnn.readNetFromTensorflow(weightsFile, pbTXTFile) cv2.error: OpenCV(4.0.0) C:\projects\opencv-python\opencv\modules\dnn\src\tensorflow\tf_importer.cpp:616: error: (-215:Assertion failed) const_layers.insert(std::make_pair(name, li)).second in function 'cv::dnn::dnn4_v20180917::`anonymous-namespace'::addConstNodes'

I can load other original TF model uising OpenCV without any problem.

Can anyone please help resolve this issue?

Thanks

Walid-Ahmed avatar Aug 15 '19 17:08 Walid-Ahmed

I have not seen this error, but I have not also tried to load models with tf_importer of OpenCV. The error seems to be around the const_layers. Have you checked line 616 of the tf_importer.cpp to get a more detailed understanding of what's going on around the addConstNodes call?

amir-abdi avatar Sep 03 '19 21:09 amir-abdi

hi iam having a similar issue loading my model did you find a work around to this?

temi92 avatar Apr 27 '20 20:04 temi92