Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions guides/md/orbax_checkpoint.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,12 @@ import orbax.checkpoint as ocp
## Orbax Callback

We need to create two main utilities to manage Orbax checkpointing in Keras:

1. `KerasOrbaxCheckpointManager`: A wrapper around
`orbax.checkpoint.CheckpointManager` for Keras models.
`KerasOrbaxCheckpointManager` uses `Model`'s `get_state_tree` and
`set_state_tree` APIs to save and restore the model variables.

2. `OrbaxCheckpointCallback`: A Keras callback that uses
`KerasOrbaxCheckpointManager` to automatically save and restore model states
during training.
Expand Down Expand Up @@ -278,8 +280,5 @@ d manifest.ocdbt
08372fc5734e445753b38235cb522988 c8af54d085d2d516444bd71f32a3787c
4601db15b67650f7c8818bfc8afeb9f5 cfe1e3ea313d637df6f6d2b2c66ca17a
a6ca20e04d8fe161ed95f6f71e8fe113

/usr/local/google/home/ssaadat/anaconda3/envs/keras-io/lib/python3.10/pty.py:89: RuntimeWarning: os.fork() was called. os.fork() is incompatible with multithreaded code, and JAX is multithreaded, so this will likely lead to a deadlock.
pid, fd = os.forkpty()
```
</div>
2 changes: 2 additions & 0 deletions guides/orbax_checkpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,12 @@
## Orbax Callback
We need to create two main utilities to manage Orbax checkpointing in Keras:
1. `KerasOrbaxCheckpointManager`: A wrapper around
`orbax.checkpoint.CheckpointManager` for Keras models.
`KerasOrbaxCheckpointManager` uses `Model`'s `get_state_tree` and
`set_state_tree` APIs to save and restore the model variables.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need that newline? Won't that cause Markdown to restart the count to 1. ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looked fine when I locally brought it up but we probably don't need it, let me render it again without a newline between numbers.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed

2. `OrbaxCheckpointCallback`: A Keras callback that uses
`KerasOrbaxCheckpointManager` to automatically save and restore model states
during training.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

While the added spacing here improves readability, it appears the corresponding Jupyter notebook file (guides/ipynb/orbax_checkpoint.ipynb) has not been regenerated to reflect this change. Since this Python script acts as the source, please ensure all generated artifacts are updated for consistency.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The formatting issue doesn't appear on the ipynb file so we don't need to update that.

Expand Down