You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note that if model.fit is not called, the model will be loaded fine.
The error that occurs is:
Traceback (most recent call last):
File "loading_minimal_example.py", line 39, in <module>
model = tf.keras.models.load_model(
File "/home/bjkomer/anaconda3/envs/myenv/lib/python3.8/site-packages/tensorflow/python/keras/saving/save.py", line 212, in load_model
return saved_model_load.load(filepath, compile, options)
File "/home/bjkomer/anaconda3/envs/myenv/lib/python3.8/site-packages/tensorflow/python/keras/saving/saved_model/load.py", line 138, in load
keras_loader.load_layers(compile=compile)
File "/home/bjkomer/anaconda3/envs/myenv/lib/python3.8/site-packages/tensorflow/python/keras/saving/saved_model/load.py", line 380, in load_layers
self.loaded_nodes[node_metadata.node_id] = self._load_layer(
File "/home/bjkomer/anaconda3/envs/myenv/lib/python3.8/site-packages/tensorflow/python/keras/saving/saved_model/load.py", line 417, in _load_layer
obj, setter = self._revive_from_config(identifier, metadata, node_id)
File "/home/bjkomer/anaconda3/envs/myenv/lib/python3.8/site-packages/tensorflow/python/keras/saving/saved_model/load.py", line 431, in _revive_from_config
obj = self._revive_metric_from_config(metadata)
File "/home/bjkomer/anaconda3/envs/myenv/lib/python3.8/site-packages/tensorflow/python/keras/saving/saved_model/load.py", line 540, in _revive_metric_from_config
obj = metrics.deserialize(
File "/home/bjkomer/anaconda3/envs/myenv/lib/python3.8/site-packages/tensorflow/python/keras/metrics.py", line 3446, in deserialize
return deserialize_keras_object(
File "/home/bjkomer/anaconda3/envs/myenv/lib/python3.8/site-packages/tensorflow/python/keras/utils/generic_utils.py", line 346, in deserialize_keras_object
(cls, cls_config) = class_and_config_for_serialized_keras_object(
File "/home/bjkomer/anaconda3/envs/myenv/lib/python3.8/site-packages/tensorflow/python/keras/utils/generic_utils.py", line 311, in class_and_config_for_serialized_keras_object
deserialized_objects[key] = deserialize_keras_object(
File "/home/bjkomer/anaconda3/envs/myenv/lib/python3.8/site-packages/tensorflow/python/keras/utils/generic_utils.py", line 360, in deserialize_keras_object
return cls.from_config(cls_config)
File "/home/bjkomer/anaconda3/envs/myenv/lib/python3.8/site-packages/tensorflow/python/keras/metrics.py", line 642, in from_config
return super(MeanMetricWrapper, cls).from_config(config)
File "/home/bjkomer/anaconda3/envs/myenv/lib/python3.8/site-packages/tensorflow/python/keras/engine/base_layer.py", line 720, in from_config
return cls(**config)
TypeError: __init__() got an unexpected keyword argument 'reduction'
The text was updated successfully, but these errors were encountered:
Yea, looks like it is actually an issue on their end, I opened one on there: tensorflow/tensorflow#48235
I also noticed if you don't include metrics it works fine.
Minimal example to reproduce the issue:
This was tested with tf version 2.4.1 and keras_lmu version 0.3.1
Note that if
model.fit
is not called, the model will be loaded fine.The error that occurs is:
The text was updated successfully, but these errors were encountered: