ray.rllib.algorithms.algorithm.Algorithm.save_checkpoint#

Algorithm.save_checkpoint(checkpoint_dir: str) None[source]#

Exports checkpoint to a local directory.

The structure of an Algorithm checkpoint dir will be as follows:

policies/
    pol_1/
        policy_state.pkl
    pol_2/
        policy_state.pkl
learner/
    learner_state.json
    module_state/
        module_1/
            ...
    optimizer_state/
        optimizers_module_1/
            ...
rllib_checkpoint.json
algorithm_state.pkl

Note: rllib_checkpoint.json contains a “version” key (e.g. with value 0.1) helping RLlib to remain backward compatible wrt. restoring from checkpoints from Ray 2.0 onwards.

Parameters:

checkpoint_dir – The directory where the checkpoint files will be stored.