Make sure save_dir can be empty str (#15638)
This commit is contained in:
parent
164e5a7b3e
commit
c53dc205ed
|
@ -584,7 +584,10 @@ class ModelCheckpoint(Checkpoint):
|
|||
return self.dirpath
|
||||
|
||||
if len(trainer.loggers) > 0:
|
||||
save_dir = trainer.loggers[0].save_dir or trainer.default_root_dir
|
||||
if trainer.loggers[0].save_dir is not None:
|
||||
save_dir = trainer.loggers[0].save_dir
|
||||
else:
|
||||
save_dir = trainer.default_root_dir
|
||||
name = trainer.loggers[0].name
|
||||
version = trainer.loggers[0].version
|
||||
version = version if isinstance(version, str) else f"version_{version}"
|
||||
|
|
Loading…
Reference in New Issue