Skip to content

Question about 'NoneType' object is not subscriptable #18

@fangchao

Description

@fangchao

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions