keras_to_tensorflow icon indicating copy to clipboard operation
keras_to_tensorflow copied to clipboard

Get error converting this basic model

Open EricTheRed20 opened this issue 4 years ago • 2 comments

When I create the following model file and then try to convert it, I get an error:-

"TypeError: Keras symbolic inputs/outputs do not implement op. You may be trying to pass Keras symbolic inputs/outputs to a TF API that does not register dispatching, preventing Keras from automatically converting the API call to a lambda layer in the Functional Model."

Am I doing something wrong is is it a bug?

from keras.models import Model
from keras.models import Input
from keras.layers import Conv2D

# Build the model (this is a minimalist version of a much bigger model)
in_image = Input(shape=(256,256,3))
out_image = Conv2D(512, (4,4))(in_image)
model = Model(in_image, out_image)
model.compile()

# Save the model file
model.save("test_model.h5") #, include_optimizer=True
print("Saved OK")

EricTheRed20 avatar Jun 30 '21 00:06 EricTheRed20

I got the same issue...

Levon-Wild avatar Mar 25 '22 07:03 Levon-Wild

There is a solution I founded. It works to me. https://www.olvidarkaka.com/contents/2403

Levon-Wild avatar Mar 25 '22 07:03 Levon-Wild