Python version 3.7
Keras version 2.3.1
TensorFlow version 1.14.0
I am wanting to run my UNet Keras model using OpenCV's readNetFromTensorflow in C++. I have successfully converted my HDF5 file to .pb per this issue: How we can convert keras model .h5 file to tensorflow saved model (.pb)
However when I try and run the command (in python first for ease of testing):
net = cv.dnn.readNetFromTensorflow('tensorflow/my_model.pb')
I receive the failure:
error: (-2) Unknown layer type Shape in op decoder_stage0_upsampling/Shape in function cv::dnn::experimental_dnn_v2::`anonymous-namespace'::TFImporter::populateNet
Is there a workaround to this using OpenCV? Or will using Tensorflows C++ API be best in this situation.