Skip to content

Commit

Permalink
implement latest_checkpoint.
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkDaoust authored Sep 11, 2024
1 parent 774fbc8 commit 9555b66
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion site/en/tutorials/distribute/keras.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,10 @@
},
"outputs": [],
"source": [
"model.load_weights(tf.train.latest_checkpoint(checkpoint_dir))\n",
"import pathlib\n",
"latest_checkpoint = sorted(pathlib.Path(checkpoint_dir).glob('*'))[-1]\n",
"\n",
"model.load_weights(latest_checkpoint)\n",
"\n",
"eval_loss, eval_acc = model.evaluate(eval_dataset)\n",
"\n",
Expand Down

0 comments on commit 9555b66

Please sign in to comment.