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

How do you run examples using python main.py? #20

Open
jackwilkinson255 opened this issue Jun 21, 2020 · 0 comments
Open

How do you run examples using python main.py? #20

jackwilkinson255 opened this issue Jun 21, 2020 · 0 comments

Comments

@jackwilkinson255
Copy link

jackwilkinson255 commented Jun 21, 2020

How do you run mbpo/examples/development/main.py on command line using 'python main.py', rather than doing:

mbpo run_local examples.development --config=examples.config.halfcheetah.0 --gpus=1 --trial-gpus=1

Here's what I've changed in the main.py file but it doesn't work:

def main(argv=None):
    """Run ExperimentRunner locally on ray.

    To run this example on cloud (e.g. gce/ec2), use the setup scripts:
    'softlearning launch_example_{gce,ec2} examples.development <options>'.

    Run 'softlearning launch_example_{gce,ec2} --help' for further
    instructions.
    """
    # __package__ should be `development.main`

    run_example_local('examples.development.main', argv, local_mode=True)

if __name__ == '__main__':

    main(argv = ['--config=examples.config.halfcheetah.0', '--gpus=1', '--trial-gpus=1'])

Gets the error:

Traceback (most recent call last):
  File "/home/jack/repos/mbpo/examples/development/main.py", line 255, in <module>
    main(argv = ['--config=examples.config.halfcheetah.0', '--gpus=1', '--trial-gpus=1'])
  File "/home/jack/repos/mbpo/examples/development/main.py", line 248, in main
    run_example_local('examples.development.main', argv, local_mode=True)
  File "/home/jack/repos/mbpo/examples/instrument.py", line 205, in run_example_local
    example_args = example_module.get_parser().parse_args(example_argv)
AttributeError: module 'examples.development.main' has no attribute 'get_parser'

I'd like to run it this way for debugging purposes

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

No branches or pull requests

1 participant