ray.rllib.algorithms.algorithm.Algorithm.restore_from_path#
- Algorithm.restore_from_path(path, *args, **kwargs)[source]#
Restores the state of the implementing class from the given path.
If the
componentarg is provided,pathrefers to a checkpoint of a subcomponent ofself, thus allowing the user to load only the subcomponent’s state intoselfwithout affecting any of the other state information (for example, loading only the NN state into a Checkpointable, which contains such an NN, but also has other state information that should NOT be changed by calling this method).The given
pathshould have the following structure and contain the following files:path/ [component1]/ [component1 subcomponentA]/ ... [component1 subcomponentB]/ ... [component2]/ ... [cls.METADATA_FILE_NAME] (json) [cls.STATE_FILE_NAME] (pkl|msgpack)
Note that the self.METADATA_FILE_NAME file is not required to restore the state.
- Parameters:
path – The path to load the implementing class’ state from or to load the state of only one subcomponent’s state of the implementing class (if
componentis provided).component – If provided,
pathis interpreted as the checkpoint path of only the subcomponent and thus, only that subcomponent’s state is restored/loaded. All other state ofselfremains unchanged in this case.filesystem – PyArrow FileSystem to use to access data at the
path. If not specified, this is inferred from the URI scheme ofpath.**kwargs – Forward compatibility kwargs.