-
Notifications
You must be signed in to change notification settings - Fork 631
Open
Labels
area/docsInvolves documentation – problems, ideas, requestsInvolves documentation – problems, ideas, requestskind/feature-requestNew feature or requestNew feature or request
Description
In issue #56, there is a request for improving the docs:
Would like to +1 this, and ask that it is made clear(er) in the documentation that although
savewon't work,save_weightswill.This is because the error given when calling
savedoesn't indicate that this is the problem; in my case, I gotFile "(virtual environment)/lib/python3.8/site-packages/tensorflow/python/saved_model/nested_structure_coder.py", line 98, in encode_structure return self._map_structure(nested_structure, self._get_encoders()) File "(virtual environment)/lib/python3.8/site-packages/tensorflow/python/saved_model/nested_structure_coder.py", line 82, in _map_structure return do(pyobj, recursion_fn) File "(virtual environment)/lib/python3.8/site-packages/tensorflow/python/saved_model/nested_structure_coder.py", line 237, in do_encode pair.value.CopyFrom(encode_fn(named_tuple_value._asdict()[key])) File "(virtual environment)/lib/python3.8/site-packages/tensorflow/python/saved_model/nested_structure_coder.py", line 82, in _map_structure return do(pyobj, recursion_fn) File "(virtual environment)/lib/python3.8/site-packages/tensorflow/python/saved_model/nested_structure_coder.py", line 206, in do_encode encoded_dict.dict_value.fields[key].CopyFrom(encode_fn(value)) File "(virtual environment)/lib/python3.8/site-packages/tensorflow/python/saved_model/nested_structure_coder.py", line 83, in _map_structure raise NotEncodableError( tensorflow.python.saved_model.nested_structure_coder.NotEncodableError: No encoder for object [<tensorflow.python.keras.initializers.initializers_v2.RandomUniform object at 0x7f241a041880>] of type [<class 'tensorflow.python.keras.initializers.initializers_v2.RandomUniform'>].Only when explicitly calling the model's
get_config()method did I getFile "learn_params.py", line 194, in <module> print(model.get_config()) File "(virtual environment)/lib/python3.8/site-packages/tensorflow/python/keras/engine/functional.py", line 598, in get_config return copy.deepcopy(get_network_config(self)) File "(virtual environment)/lib/python3.8/site-packages/tensorflow/python/keras/engine/functional.py", line 1278, in get_network_config layer_config = serialize_layer_fn(layer) File "(virtual environment)/lib/python3.8/site-packages/tensorflow/python/keras/utils/generic_utils.py", line 250, in serialize_keras_object raise e File "(virtual environment)/lib/python3.8/site-packages/tensorflow/python/keras/utils/generic_utils.py", line 245, in serialize_keras_object config = instance.get_config() File "(virtual environment)/lib/python3.8/site-packages/tensorflow/python/keras/engine/base_layer.py", line 676, in get_config raise NotImplementedError('Layer %s has arguments in `__init__` and ' NotImplementedError: Layer ControlledPQC has arguments in `__init__` and therefore must override `get_config`.
Metadata
Metadata
Assignees
Labels
area/docsInvolves documentation – problems, ideas, requestsInvolves documentation – problems, ideas, requestskind/feature-requestNew feature or requestNew feature or request