keras-io
keras-io copied to clipboard
Imposible to save model for : bayesian_neural_networks.py
When i simply do: prob_bnn_model.save('model') after the run_experiment was called on prob_bnn_model.
Then I am getting error message:
Traceback (most recent call last):
File "gitCopy.py", line 403, in tf.Tensor
is not allowed: AutoGraph did convert this function. This might indicate you are trying to use an unsupported feature.
When i try to save it in H5 format then message is:
Traceback (most recent call last):
File "gitCopy.py", line 403, in __init__
and therefore must override get_config()
.
Example:
class CustomLayer(keras.layers.Layer):
def init(self, arg1, arg2):
super().init()
self.arg1 = arg1
self.arg2 = arg2
def get_config(self):
config = super().get_config()
config.update({
"arg1": self.arg1,
"arg2": self.arg2,
})
return config
@fchollet Any advice how to save my model based on this code ?