Skip to content

fix: Model save format deprecated in Keras 3 #3623

Description

@hamztouiz

Description

The hello_world training script fails with Keras 3 due to the save_format argument being deprecated.

Error

ValueError: The `save_format` argument is deprecated in Keras 3. 
Please remove this argument and pass a file path with either `.keras` or `.h5` extension.
Received: save_format=tf

Location

tensorflow/lite/micro/examples/hello_world/train.py line 123

Expected behavior

The training script should successfully save the model without errors.

Current behavior

The script fails when attempting to save the model due to the deprecated save_format argument.

Solution

Replace the TensorFlow SavedModel format with Keras native format (.keras) which is the recommended approach in Keras 3.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:bugSomething isn't working as intended.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions