mirror of
https://github.com/vale981/ray
synced 2025-03-06 10:31:39 -05:00
[tune] Fixed save_to_dir w/ os.replace (#14510)
The method save_to_dir of the class Searcher in ray.tune.suggest.suggestion.py uses the os.rename method to replace tmp_search_ckpt to current ckpt. os.rename method will raise the [WinError 183] or file exists error of other operating system. os.replace is the currect way.
This commit is contained in:
parent
2395e25fc0
commit
33b271aa97
1 changed files with 1 additions and 1 deletions
|
@ -265,7 +265,7 @@ class Searcher:
|
|||
success = False
|
||||
|
||||
if success and os.path.exists(tmp_search_ckpt_path):
|
||||
os.rename(
|
||||
os.replace(
|
||||
tmp_search_ckpt_path,
|
||||
os.path.join(checkpoint_dir,
|
||||
self.CKPT_FILE_TMPL.format(session_str)))
|
||||
|
|
Loading…
Add table
Reference in a new issue