Browse Source

fix all_model_checkpoint_paths in checkpoint file.

tags/v0.20
Oceania2018 5 years ago
parent
commit
f33b2034f8
2 changed files with 6 additions and 5 deletions
  1. +0
    -1
      src/TensorFlowNET.Core/Training/Saving/Saver.cs
  2. +6
    -4
      src/TensorFlowNET.Core/Training/Saving/checkpoint_management.py.cs

+ 0
- 1
src/TensorFlowNET.Core/Training/Saving/Saver.cs View File

@@ -191,7 +191,6 @@ namespace Tensorflow
{
var path = UTF8Encoding.UTF8.GetString((byte[])model_checkpoint_path[0]);
_RecordLastCheckpoint(path);
_RecordLastCheckpoint(model_checkpoint_path[0].ToString());
checkpoint_management.update_checkpoint_state_internal(
save_dir: save_path_parent,
model_checkpoint_path: path,


+ 6
- 4
src/TensorFlowNET.Core/Training/Saving/checkpoint_management.py.cs View File

@@ -65,11 +65,13 @@ namespace Tensorflow
"checkpoint state. Please use a different save path.");

// File.WriteAllText(coord_checkpoint_filename, ckpt.ToString());
File.WriteAllLines(coord_checkpoint_filename, new[]
var checkpoints = new List<string>
{
$"model_checkpoint_path: \"{ckpt.ModelCheckpointPath}\"",
$"all_model_checkpoint_paths: \"{ckpt.AllModelCheckpointPaths[0]}\"",
});
$"model_checkpoint_path: \"{ckpt.ModelCheckpointPath}\""
};
checkpoints.AddRange(all_model_checkpoint_paths.Select(x => $"all_model_checkpoint_paths: \"{x}\""));

File.WriteAllLines(coord_checkpoint_filename, checkpoints);
}

/// <summary>


Loading…
Cancel
Save