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

TypeError: DRLAgent.DRL_prediction() missing 1 required positional argument: 'env_args' #1196

Open
burger456 opened this issue Apr 2, 2024 · 2 comments

Comments

@burger456
Copy link

When I tested with this finrl, I encountered a problem with missing parameters. Can the test cases in Frinl still be used? Do you need improvement?

` if options.mode =="test":
from finrl import test
from finrl import train

    env = StockTradingEnv

    #ELEgantrl
    kwargs={'method': 'GET', 'url': 'https://apidojo-yahoo-finance-v1.p.rapidapi.com/auto-complete', 'params': { 'q': 'tesla', 'region': 'US' }, 'headers': { 'X-RapidAPI-Key': 'c74c8437ffmshd98594af221767dp1b31ebjsnfbf6d6a8b695', 'X-RapidAPI-Host': 'apidojo-yahoo-finance-v1.p.rapidapi.com' }}

    account_value_erl = test(start_date=TEST_START_DATE,
                             end_date=TEST_END_DATE,
                             ticker_list=DOW_30_TICKER,
                             data_source="yahoofinance",
                             time_interval="1D",
                             technical_indicator_list=INDICATORS,
                             drl_lib="elegantrl",
                             env=env,
                             model_name="ppo",
                             cwd="./test_ppo",
                             net_dimension=512,
                             kwargs=kwargs)`
@ghyzx
Copy link

ghyzx commented Apr 28, 2024

i meet the same issue, may i know any update for this?

File "xxx/FinRL/finrl/test.py", line 53, in test episode_total_assets = DRLAgent_erl.DRL_prediction( TypeError: DRLAgent.DRL_prediction() missing 1 required positional argument: 'env_args'

@DerekChu-YF
Copy link

DerekChu-YF commented May 16, 2024

Problem found: mising one parameter
just add env_args = env_config to

DRLAgent_erl.DRL_prediction(
model_name=model_name,
cwd=cwd,
net_dimension=net_dimension,
environment=env_instance,
env_args = env_config
)

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

3 participants