fix deprecated default_save_path (#1449)
This commit is contained in:
parent
dcda5194df
commit
d05ac813dc
|
@ -89,6 +89,20 @@ class TrainerDeprecatedAPITillVer0_8(ABC):
|
|||
" and this method will be removed in v0.8.0", DeprecationWarning)
|
||||
self.num_sanity_val_steps = nb
|
||||
|
||||
@property
|
||||
def default_save_path(self):
|
||||
"""Back compatibility, will be removed in v0.8.0"""
|
||||
rank_zero_warn("Attribute `default_save_path` has renamed to `default_root_dir` since v0.5.x"
|
||||
" and this method will be removed in v0.8.0", DeprecationWarning)
|
||||
return self.default_root_dir
|
||||
|
||||
@default_save_path.setter
|
||||
def default_save_path(self, path):
|
||||
"""Back compatibility, will be removed in v0.8.0"""
|
||||
rank_zero_warn("Attribute `default_save_path` has renamed to `default_root_dir` since v0.5.x"
|
||||
" and this method will be removed in v0.8.0", DeprecationWarning)
|
||||
self.default_root_dir = path
|
||||
|
||||
|
||||
class TrainerDeprecatedAPITillVer0_9(ABC):
|
||||
|
||||
|
|
|
@ -34,6 +34,7 @@ def test_tbd_remove_in_v0_8_0_trainer():
|
|||
'max_nb_epochs': 'max_epochs',
|
||||
'min_nb_epochs': 'min_epochs',
|
||||
'nb_sanity_val_steps': 'num_sanity_val_steps',
|
||||
'default_save_path': 'default_root_dir',
|
||||
}
|
||||
# skip 0 since it may be interested as False
|
||||
kwargs = {k: (i + 1) for i, k in enumerate(mapping_old_new)}
|
||||
|
|
Loading…
Reference in New Issue