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

Error when trying to run example commands #596

Open
nhansendev opened this issue Dec 31, 2021 · 1 comment
Open

Error when trying to run example commands #596

nhansendev opened this issue Dec 31, 2021 · 1 comment

Comments

@nhansendev
Copy link

When I try running the example commands I am unable to use them as-written:

export CONFIG=reagent/gym/tests/configs/cartpole/discrete_dqn_cartpole_online.yaml
./reagent/workflow/cli.py run reagent.gym.tests.test_gym.run_test $CONFIG

The problem is that my setup (Conda -> Python 3.8 env on Linux) doesn't recognize the command or thinks that I've entered too many parameters. I try to get around this by creating a .py file to run the commands instead like so:

from reagent.workflow.cli import run
import sys

if __name__ == "__main__":
    config_path = '/home/nate/Desktop/Atom/ReAgent/reagent/gym/tests/configs/cartpole/discrete_c51_cartpole_online.yaml'
    action = 'reagent.workflow.gym_batch_rl.offline_gym_random'
    sys.argv += [action, config_path]
    run()

However, this results in an error stating that I haven't provided enough parameters for the config:

Traceback (most recent call last):
  File "/home/nate/Desktop/Atom/ReAgent/test.py", line 12, in <module>
    run()
  File "/home/nate/miniconda3/envs/py_38/lib/python3.8/site-packages/click/core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "/home/nate/miniconda3/envs/py_38/lib/python3.8/site-packages/click/core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "/home/nate/miniconda3/envs/py_38/lib/python3.8/site-packages/click/core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/nate/miniconda3/envs/py_38/lib/python3.8/site-packages/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "/home/nate/Desktop/Atom/ReAgent/reagent/workflow/cli.py", line 82, in run
    config = ConfigClass(**config_dict)
TypeError: __init__() missing 4 required positional arguments: 'env_name', 'pkl_path', 'num_train_transitions', and 'max_steps'

I've checked and the yaml file is being correctly imported, but it does not contain the information being requested.
Clearly I'm doing something wrong. Please let me know how I might address the issue.
I've run tox to check and most items passed, but not all. Could this be a contributing factor?

@czxttkl
Copy link
Contributor

czxttkl commented Jan 3, 2022

Hi @Obliman, we will check after the holidays. Thanks for reporting.

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

2 participants