How can I convert keras model (.h5) into tensorflow (.pb) model to use in opencv DNN module?

asked 2019-12-19 03:15:05 -0600

ibrahim_5403 gravatar image

updated 2019-12-19 03:15:42 -0600

I want to convert keras model into tensorflow to use in opencv DNN module. I already converted into .pb file, but when I am going to use opencv DNN module, it gives the following error:

error: OpenCV(4.1.0) C:\projects\opencv-python\opencv\modules\dnn\src\tensorflow\tf_importer.cpp:497: error: (-2:Unspecified error) Input layer not found: ROI_5/split/value in function 'cv::dnn::dnn4_v20190122::`anonymous-namespace'::TFImporter::connect'

How can I solve it, is there any suggestion please?

edit retag flag offensive close merge delete

Comments

I already converted into .pb file,

please show your model code, and the conversion to pb

berak gravatar imageberak ( 2019-12-19 03:32:36 -0600 )edit
1

please update opencv version : last version is 4.1.2

LBerger gravatar imageLBerger ( 2019-12-19 04:23:14 -0600 )edit