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

DRL_prediction error #28

Open
vadim7s opened this issue Feb 14, 2021 · 0 comments
Open

DRL_prediction error #28

vadim7s opened this issue Feb 14, 2021 · 0 comments

Comments

@vadim7s
Copy link

vadim7s commented Feb 14, 2021

Hi, great article once again,

I am trying to predict using trained models but get the same error in both single and multi stock scenarios.
When I run prediction:

trade = data_split(processed_full, '2019-01-01','2021-01-01')
e_trade_gym = StockTradingEnv(df = trade, turbulence_threshold = 332, **env_kwargs)
df_account_value, df_actions = DRLAgent.DRL_prediction(model=model_sac, environment = e_trade_gym)

the code above gives this error
ValueError: Length mismatch: Expected axis has 0 elements, new values have 1 elements

the error happens in this location:
~\Anaconda3\envs\py36\lib\site-packages\finrl\model\models.py in DRL_prediction(model, environment)
78 action, _states = model.predict(test_obs)
79 account_memory = test_env.env_method(method_name="save_asset_memory")
---> 80 actions_memory = test_env.env_method(method_name="save_action_memory")
81 test_obs, rewards, dones, info = test_env.step(action)
82 if dones[0]:

I am using Jupyter notebook downloaded as of Feb 9, 2021, something must have changed in the modules since you ran it
Thanks
Vadim

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