Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[tune] Relative local_dir is not supported. #4724

Closed
pengzhenghao opened this issue May 1, 2019 · 0 comments · Fixed by #4734
Closed

[tune] Relative local_dir is not supported. #4724

pengzhenghao opened this issue May 1, 2019 · 0 comments · Fixed by #4734

Comments

@pengzhenghao
Copy link
Contributor

pengzhenghao commented May 1, 2019

System information

  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): macOS Mojave
  • Ray installed from (source or binary):
  • Ray version:0.7.0.dev2
  • Python version:3.6
  • Exact command to reproduce:

Describe the problem

If you use

        tune.run(
            self.algo,
            name="TuneRelavtieLocalDirTest",
            stop={"training_iteration": 1},
            checkpoint_freq=1,
            local_dir="ray_result", 
            config={
                "env": "CartPole-v0",
            },
        )

The path of checkpoint turned out to be: $CURRENT_DIR/ray_result/TuneRelavtieLocalDirTest/PG_CartPole-v0_0_2019-05-01_15-24-54xo9z1bq8/ray_result/TuneRelavtieLocalDirTest/PG_CartPole-v0_0_2019-05-01_15-24-54xo9z1bq8/checkpoint_1/checkpoint-1

image

You can see that the path is nested. It is ought to be $CURRENT_DIR/ray_result/TuneRelavtieLocalDirTest/PG_CartPole-v0_0_2019-05-01_15-24-54xo9z1bq8/checkpoint_1/checkpoint-1

Using local_dir with dot identifier gives the same result.

        tune.run(
            self.algo,
            name="TuneRelavtieLocalDirTest",
            stop={"training_iteration": 1},
            checkpoint_freq=1,
            local_dir="./ray_result", # This should be ray/tune/tests/ray_result
            config={
                "env": "CartPole-v0",
            },
        )

Why this matter? Because in some cases, user needs to take away all the experiments results within their directory of codes, via git or FTP.


What about using absolute path?

        abs_path = os.path.abspath("ray_result3")
        print("abs_path:", abs_path) # abs_path: /Users/XXX/ray/python/ray/ray_result3

        tune.run(
            self.algo,
            name="TuneRelavtieLocalDirTest",
            stop={"training_iteration": 1},
            checkpoint_freq=1,
            local_dir=abs_path, # This should be ray/tune/tests/ray_result3
            config={
                "env": "CartPole-v0",
            },
        )

It's correct!

image

Discussion

I think maybe we can divide the local_dir into three kinds:

  1. "./result"
  2. "result"
  3. "/User/XXX/result"
  4. "~/result"

We should consider No.1 & 2 to be the relative path and the last two as absolute path.

@pengzhenghao pengzhenghao changed the title Relative local_dir is not supported. [tune] Relative local_dir is not supported. May 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant