Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Importing model using Tf and Keras Error #13

Open
mendaxfz opened this issue Sep 16, 2020 · 1 comment
Open

Importing model using Tf and Keras Error #13

mendaxfz opened this issue Sep 16, 2020 · 1 comment

Comments

@mendaxfz
Copy link

Importing the model using tensorflow and keras gives me the following error:

NameError Traceback (most recent call last)
in ()
----> 1 model = tf.keras.models.load_model('model.h5')

12 frames
/usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/layers/core.py in (x)
680
681 def compute_output_shape(self, input_shape):
--> 682 input_shape = tensor_shape.as_shape(input_shape).as_list()
683 if not input_shape:
684 output_shape = tensor_shape.TensorShape([1])

NameError: name 'customPooling' is not defined

@ranasac19878
Copy link
Collaborator

I think you will need to save the customPooling layer as custom object while saving your model. See below link for help:
https://www.tensorflow.org/guide/keras/save_and_serialize

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants