mirror of
https://github.com/wassname/ray.git
synced 2026-08-11 11:24:51 +08:00
[tune/rllib] Add checkpoint eraser (#4490)
This commit is contained in:
committed by
Eric Liang
parent
7746d20d30
commit
820c71b7d0
@@ -210,6 +210,17 @@ class Trainable(object):
|
||||
|
||||
return result
|
||||
|
||||
def delete_checkpoint(self, checkpoint_dir):
|
||||
"""Removes subdirectory within checkpoint_folder
|
||||
Parameters
|
||||
----------
|
||||
checkpoint_dir : path to checkpoint
|
||||
"""
|
||||
if os.path.isfile(checkpoint_dir):
|
||||
shutil.rmtree(os.path.dirname(checkpoint_dir))
|
||||
else:
|
||||
shutil.rmtree(checkpoint_dir)
|
||||
|
||||
def save(self, checkpoint_dir=None):
|
||||
"""Saves the current model state to a checkpoint.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user