window -> tuner.restor() -> error
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- python
- Domain
- machine-learning
Research direction
Start with the restore entry points in ray/tune/tuner.py and ray/tune/impl/tuner_internal.py, especially _restore_from_path_or_uri and the failing pathlib replace call. Reproduce the Windows cross-drive restore using the provided script and paths, then verify that restoration no longer raises WinError 17.
Written by the indexing model from the issue text.
Description
What happened + What you expected to happen
When I use the restore function of ray, I get an error as follows
can restore
Traceback (most recent call last):
File "E:\work\mapfalgo\test.py", line 42, in
ans = restore(path)
File "E:\work\mapfalgo\test.py", line 33, in restore
tuner.restore(restore_path)
File "E:\work\mapfalgo\venv\lib\site-packages\ray\tune\tuner.py", line 264, in restore
tuner_internal = TunerInternal(
File "E:\work\mapfalgo\venv\lib\site-packages\ray\tune\impl\tuner_internal.py", line 111, in init
self._restore_from_path_or_uri(
File "E:\work\mapfalgo\venv\lib\site-packages\ray\tune\impl\tuner_internal.py", line 360, in _restore_from_path_or_uri
file_dir.replace(new_exp_path / file_dir.name)
File "C:\Users\TOP\AppData\Local\Programs\Python\Python38\lib\pathlib.py", line 1381, in replace
self._accessor.replace(self, target)
OSError: [WinError 17] 系统无法将文件移到不同的磁盘驱动器。: 'C:\Users\TOP\AppData\Local\Temp\tmpn84ziw3mtmp_experiment_dir\trainable.pkl' -> 'E:\test\PPO\trainable.pkl'
Versions / Dependencies
ray=2.4.0
python=3.8
window
Reproduction script
my code like this:
def train():
import ray
from ray.rllib.algorithms.ppo import PPOConfig
from ray import air
from ray import tune
ray.init()
config = PPOConfig()
config = config.environment(env="CartPole-v1")
# Use to_dict() to get the old-style python config dict
# when running with tune.
tune.Tuner(
"PPO",
run_config=air.RunConfig(stop={"episode_reward_mean": 200},
local_dir=r'E:\test',
),
param_space=config.to_dict(),
).fit()
def restore(restore_path):
from ray import tune
tuner = tune.Tuner
assert tuner.can_restore(restore_path), "restore_path path error! cannot obtain trainable.pkl!"
print('can restore')
# 从指定的checkpoint恢复训练
tuner.restore(restore_path)
print("restore success!")
return tuner
if name == "main":
train()
path = r'E:\test\PPO'
ans = restore(path)
Issue Severity
Low: It annoys or frustrates me.
- Dominant language
- Python
- Stars
- 43.9k
- Forks
- 8.1k
- Avg merge
- 4d 12h
- Merged PRs (30d)
- 234
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ray-project/ray
-
community-backlog core stability
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
ray-project/ray#66333 ·
-
community-backlog core stability
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
ray-project/ray#66331 ·
-
[core][gcs] HandleUnregisterNode does not reply when the node is already removed, hanging the raylet Opencommunity-backlog core stability
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
ray-project/ray#66329 ·
-
[Serve][Docs] In-place updates guide doesn't mention that code-update replica restarts are rolling Opencommunity-backlog docs serve usability
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
ray-project/ray#66265 ·
-
community-backlog core docs stability usability
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
ray-project/ray#66114 · 1 comment ·
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
bancolombia/sentinel#23 ·
-
test md OpenCI
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
bug client
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100