Stop Model.save_weights from printing a deprication warning (TF format)
Also has it save relative paths in the checkpoint proto, which removes a behavior difference between it and CheckpointManager. PiperOrigin-RevId: 227586345
This commit is contained in:
parent
85ca0e9b81
commit
790a635a04
@ -1382,9 +1382,10 @@ class Network(base_layer.Layer):
|
|||||||
% (optimizer,))
|
% (optimizer,))
|
||||||
self._checkpointable_saver.save(filepath, session=session)
|
self._checkpointable_saver.save(filepath, session=session)
|
||||||
# Record this checkpoint so it's visible from tf.train.latest_checkpoint.
|
# Record this checkpoint so it's visible from tf.train.latest_checkpoint.
|
||||||
checkpoint_management.update_checkpoint_state(
|
checkpoint_management.update_checkpoint_state_internal(
|
||||||
save_dir=os.path.dirname(filepath),
|
save_dir=os.path.dirname(filepath),
|
||||||
model_checkpoint_path=filepath,
|
model_checkpoint_path=filepath,
|
||||||
|
save_relative_paths=True,
|
||||||
all_model_checkpoint_paths=[filepath])
|
all_model_checkpoint_paths=[filepath])
|
||||||
|
|
||||||
def load_weights(self, filepath, by_name=False):
|
def load_weights(self, filepath, by_name=False):
|
||||||
|
Loading…
Reference in New Issue
Block a user