ray.rllib.policy.Policy.export_checkpoint#

Policy.export_checkpoint(export_dir: str, filename_prefix=- 1, *, policy_state: Optional[Dict[str, Union[numpy.array, tensorflow.python.framework.ops.Tensor, torch.Tensor, dict, tuple]]] = None) 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 additional self.get_state() calls of its different Policies.

Example

>>> from ray.rllib.algorithms.ppo import PPOTorchPolicy
>>> policy = PPOTorchPolicy(...) 
>>> policy.export_checkpoint("/tmp/export_dir")