Skip to content

[BUG] Cannot Save two tower model from 04 Retrieval Model Notebook #304

@jperez999

Description

@jperez999

Bug description

When running the 04 Retrieval Model Notebook if you try to save the two tower model after you run

model.evaluate(valid, return_dict=True, batch_size=1024)
model.save(os.path.join(DATA_FOLDER, "model"))

You get an error in the tf_utils.maybe_serialize_keras_objects function like this:

     75     config[key] = {
     76         k: tf.keras.utils.serialize_keras_object(v) for k, v in maybe_value.items()
     77     }
     78 elif isinstance(maybe_value, (list, tuple)):
---> 79     config[key] = [tf.keras.utils.serialize_keras_object(v) for v in maybe_value]
     80 else:
     81     config[key] = tf.keras.utils.serialize_keras_object(maybe_value)

AttributeError: 'NoneType' object has no attribute 'items'

Steps/Code to reproduce bug

  1. add the model save call after the model.evaluate call.
  2. run the notebook, trigger the save call.

Expected behavior

Successfully save model with all necessary artifacts.

Additional context

Would like to get this export working because it would allow me to use this dataset in the example for merlin systems.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions