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

Question about 'NoneType' object is not subscriptable #18

Open
fangchao opened this issue Feb 4, 2021 · 0 comments
Open

Question about 'NoneType' object is not subscriptable #18

fangchao opened this issue Feb 4, 2021 · 0 comments

Comments

@fangchao
Copy link

fangchao commented Feb 4, 2021

Congrats on the awesome work done and thanks for sharing.

I have create a model via subclassing and wanna to convert saved model to frozen graph.

But I have got a NoeType error at line x=tf.TensorSpec(model.inputs[0].shape, model.inputs[0].dtype))

model = tf.keras.models.load_model(saved_model, custom_objects={'loss_fn': loss_fn})
model.summary()

# Convert Keras model to ConcreteFunction
full_model = tf.function(lambda x: model(x))
full_model = full_model.get_concrete_function(
         x=tf.TensorSpec(model.inputs[0].shape, model.inputs[0].dtype))

Do you know how to solve this problem?

Thanks a lot and wait for you reply.

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

1 participant