AI4Finance-Foundation / AI4Finance-Foundation/FinRL-Trading

DRL_prediction error

Ouverte
#28 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
Python
Étoiles
3.7k
Forks
1.1k
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

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

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.