ray.rllib.policy.policy.Policy.export_checkpoint#
- Policy.export_checkpoint(export_dir: str, filename_prefix=-1, *, policy_state: Dict[str, numpy.array | jnp.ndarray | tf.Tensor | torch.Tensor | dict | tuple] | None = None, checkpoint_format: str = 'cloudpickle') None [source]#
Exports Policy checkpoint to a local directory and returns an AIR Checkpoint.
- Parameters:
export_dir – Local writable directory to store the AIR Checkpoint information into.
policy_state – An optional PolicyState to write to disk. Used by
Algorithm.save_checkpoint()
to save on the additionalself.get_state()
calls of its different Policies.checkpoint_format – Either one of ‘cloudpickle’ or ‘msgpack’.
from ray.rllib.algorithms.ppo import PPOTorchPolicy policy = PPOTorchPolicy(...) policy.export_checkpoint("/tmp/export_dir")