Monday, 18 February 2019

How to pickle Keras custom layer?

I write a custom layer class extends by Layer class, then I want to pickle the history for further analysis, but when I reload the pickle object from file, python raise an error:

Unknown Layer: Attention.

So, how can I fix it?

I have both tried get_config, __getstate__ and __setstate__, but it failed. I just want to pickle the keras history, but not the model, so please don't tell me the save model methods with custom_object parameters.



from How to pickle Keras custom layer?

No comments:

Post a Comment