Install & Compatibility
Where this runs
tested against v0.0.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
707MB installed
● package 707MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
orbax.checkpoint
✓ import orbax.checkpoint as ocp
CheckpointManager
✓ from orbax.checkpoint import CheckpointManager
CheckpointManagerOptions
✓ from orbax.checkpoint import CheckpointManagerOptions
StandardSave
✓ from orbax.checkpoint import StandardSave
✗ from orbax.checkpoint.args import StandardSave
In recent versions, StandardSave/StandardRestore moved directly under orbax.checkpoint instead of orbax.checkpoint.args
StandardRestore
✓ from orbax.checkpoint import StandardRestore
✗ from orbax.checkpoint.args import StandardRestore
In recent versions, StandardSave/StandardRestore moved directly under orbax.checkpoint instead of orbax.checkpoint.args
Demonstrates how to initialize a CheckpointManager, save JAX array data, and restore the latest checkpoint. Highlights the use of `ocp.StandardSave` and `ocp.StandardRestore` for explicit serialization arguments and the importance of `wait_until_finished()`.
import jax
import jax.numpy as jnp
import orbax.checkpoint as ocp
import os
import shutil
# Define a temporary checkpoint directory
ckpt_dir = '/tmp/my_orbax_checkpoint_example'
if os.path.exists(ckpt_dir):
shutil.rmtree(ckpt_dir)
os.makedirs(ckpt_dir, exist_ok=True)
# 1. Create a CheckpointManager
options = ocp.CheckpointManagerOptions(
save_interval_steps=1,
max_to_keep=3,
keep_time_interval_secs=None
)
mngr = ocp.CheckpointManager(ckpt_dir, options=options)
# 2. Prepare some data to save
step = 0
data_to_save = {'params': jnp.array([1.0, 2.0, 3.0])}
print(f"Saving data at step {step}: {data_to_save['params']}")
# 3. Save the checkpoint
# Ensure to wrap data with StandardSave for explicit serialization
mngr.save(step, args=ocp.StandardSave(data_to_save))
mngr.wait_until_finished() # Ensure save completes
# Simulate more steps and saves
step = 1
data_to_save = {'params': jnp.array([4.0, 5.0, 6.0])}
print(f"Saving data at step {step}: {data_to_save['params']}")
mngr.save(step, args=ocp.StandardSave(data_to_save))
mngr.wait_until_finished()
# 4. Restore the latest checkpoint
latest_step = mngr.latest_step()
if latest_step is not None:
print(f"\nRestoring data from latest step: {latest_step}")
# Provide a template for StandardRestore, even if just the expected structure
restored_data = mngr.restore(latest_step, args=ocp.StandardRestore(data_to_save))
print(f"Restored data: {restored_data['params']}")
else:
print("No checkpoint found to restore.")
# 5. Close the manager
mngr.close()
# Clean up
if os.path.exists(ckpt_dir):
shutil.rmtree(ckpt_dir)
Debug
Known issues
breakingSerialization API changes, especially with `ocp.StandardSave` and `ocp.StandardRestore`, have occurred across minor versions, requiring explicit wrappers for data.fixConsult the latest Orbax documentation and examples for `orbax.checkpoint.args` usage. Data passed to `save()` and `restore()` typically needs to be wrapped, e.g., `args=ocp.StandardSave(data)`.
affects: 0.10.x to 0.11.x (and potentially earlier major internal refactors)
gotchaCheckpointManager operations are asynchronous. Failing to call `.wait_until_finished()` can lead to incomplete or corrupted checkpoints if the program exits prematurely.fixAlways call `CheckpointManager.wait_until_finished()` after `save()` calls (or `.commit()` in older APIs) before relying on the checkpoint or exiting the program. Using `with CheckpointManager(...) as mngr:` context manager handles closing and waiting.
affects: All versions
gotchaManual modification of checkpoint directories or subfolders can interfere with CheckpointManager's internal state and cleanup logic (`max_to_keep`).fixAllow Orbax to manage checkpoint paths and directory structures. Avoid manual file operations within the `ckpt_dir` directly.
affects: All versions
Upgrade
Version history
0.12.4latest on PyPI · released Aug 12, 2026
Audit
Dependencies
tensorstorerequiredUnderlying storage and data serialization, especially for distributed checkpoints.
jaxoptionalOrbax is designed for JAX ecosystems; required for most practical applications.
flaxoptionalCommonly used with JAX and Orbax for neural network checkpointing.