Skip to content

Channel-ordered (mu, sigma) tuples not saved via Serde package #1404

@correac5

Description

@correac5

I am trying to save a model I created as a .binpb file. I had used custom priors for each channel that were saved as a tuple, the model runs and can be saved as a .pkl file, but when I run meridian_serde.save_meridian(mmm, file_path), I get the following error:

2 meridian_serde.save_meridian(mmm, file_path)

5 frames
/usr/local/lib/python3.12/dist-packages/schema/serde/distribution.py in _to_parameter_value_proto(self, param_name, value, dist)
260
261 # Handle unsupported types.
--> 262 raise TypeError(f"Unsupported type: {type(value)}, {value}")
263
264 def _from_distribution_proto(

TypeError: Unsupported type: <class 'tuple'>, (1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions