FinRL icon indicating copy to clipboard operation
FinRL copied to clipboard

Missing dependencies in elegantrl/train/config.py and .../run.py *or* Incorrect calls from finrl/agents/elegantrl/models.py

Open RichardKCook opened this issue 2 years ago • 3 comments

Describe the bug

missing dependencies from running main.py --mode=test with elegantrl demo settings.

File "/usr/local/lib/python3.7/site-packages/finrl/main.py", line 149, in raise SystemExit(main()) File "/usr/local/lib/python3.7/site-packages/finrl/main.py", line 81, in main kwargs=kwargs, File "/usr/local/lib/python3.7/site-packages/finrl/train.py", line 49, in train from finrl.agents.elegantrl.models import DRLAgent as DRLAgent_erl File "/usr/local/lib/python3.7/site-packages/finrl/agents/elegantrl/models.py", line 11, in from elegantrl.train.config import Arguments

==> ImportError: cannot import name 'Arguments' from 'elegantrl.train.config' (/usr/local/lib/python3.7/site-packages/elegantrl/train/config.py)

list of missing modules: from elegantrl.train.config import Arguments from elegantrl.train.run import init_agent from elegantrl.train.run import train_and_evaluate

A clear and concise description of what the bug is:

When running main.py in test mode, code executes until calling ...agents/elegantrl/models.py from train.py. ...agents/elegantrl/models.py calls elegantrl.train.config where many arguments and initializers exist, however the referenced imports do not exist and no function/method/class takes the correct parameters from the calls.

Line 84 in agents/elegantrl/models.py referenced call for train_and_evaluate: train_and_evaluate(model) Line 92 in agents/elegantrl/models.py referenced call for Arguments: Arguments(agent_class, env) Line 97 in agents/elegantrl/models.py referenced call for init_agent: init_agent(args, gpu_id)

To Reproduce Steps to reproduce the behavior:

  1. run main.py in test mode with elegantrl as the defined drl_lib (demo settings)
  2. See error

Expected behavior ppo analysis

Desktop (please complete the following information):

  • OS: macOS Big Sur
  • Browser: Chrome
  • Version: 11.7.1 (20G918)

Additional context No additional context to provide at this time

RichardKCook avatar Feb 12 '23 19:02 RichardKCook

same issue occurs!

valleysprings avatar Feb 13 '23 15:02 valleysprings

Does anyone know if the Config class from elegantrl.train.config is supposed to be called and not "Arguments"? The Config class takes in similar parameters and returns almost everything that's being asked of it from finrl.agents.elegantrl. If someone can help me understand what's needed or what it's trying to do, I can either build the Arguments class or append the Config class. I've edited the Config class to work with the call, but I don't know if it's executing as intended.

RichardKCook avatar Feb 15 '23 23:02 RichardKCook

From what I'm seeing, it's supposed to supply the arguments for each type of model, but I may not be reading it right. Just trying to understand and contribute where possible.

RichardKCook avatar Feb 15 '23 23:02 RichardKCook