Skip to content

Commit f33b203

Browse files
committed
fix all_model_checkpoint_paths in checkpoint file.
1 parent bd20f07 commit f33b203

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

‎src/TensorFlowNET.Core/Training/Saving/Saver.cs‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,6 @@ public string save(Session sess,
191191
{
192192
var path = UTF8Encoding.UTF8.GetString((byte[])model_checkpoint_path[0]);
193193
_RecordLastCheckpoint(path);
194-
_RecordLastCheckpoint(model_checkpoint_path[0].ToString());
195194
checkpoint_management.update_checkpoint_state_internal(
196195
save_dir: save_path_parent,
197196
model_checkpoint_path: path,

‎src/TensorFlowNET.Core/Training/Saving/checkpoint_management.py.cs‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,13 @@ public static void update_checkpoint_state_internal(string save_dir,
6565
"checkpoint state. Please use a different save path.");
6666

6767
// File.WriteAllText(coord_checkpoint_filename, ckpt.ToString());
68-
File.WriteAllLines(coord_checkpoint_filename, new[]
68+
var checkpoints = new List<string>
6969
{
70-
$"model_checkpoint_path: \"{ckpt.ModelCheckpointPath}\"",
71-
$"all_model_checkpoint_paths: \"{ckpt.AllModelCheckpointPaths[0]}\"",
72-
});
70+
$"model_checkpoint_path: \"{ckpt.ModelCheckpointPath}\""
71+
};
72+
checkpoints.AddRange(all_model_checkpoint_paths.Select(x => $"all_model_checkpoint_paths: \"{x}\""));
73+
74+
File.WriteAllLines(coord_checkpoint_filename, checkpoints);
7375
}
7476

7577
/// <summary>

0 commit comments

Comments
 (0)