FinRL
FinRL copied to clipboard
FinRL_PaperTrading_Demo packages out of sync with ElegantRL
Description When running train fn in FinRL_PaperTrading_Demo, ElegantRL Train function is called, but it gets an error:
/usr/local/lib/python3.7/dist-packages/finrl/agents/elegantrl/models.py in get_model(self, model_name, model_kwargs) 61 if model_name not in MODELS: 62 raise NotImplementedError("NotImplementedError") ---> 63 model = Arguments(agent=agent, env=env) 64 model.if_off_policy = model_name in OFF_POLICY_MODELS 65 if model_kwargs is not None:
TypeError: __init__() got an unexpected keyword argument 'agent'
.
When this issue was patched locally, other issues arose. This seems to be due to some package misalignments with newer commits.
Is there a way to use the older version of ElegantRL to rerun the notebook without issues?
To Reproduce Steps to reproduce the behavior:
- Run FinRL_PaperTrading_Demo in Colab
Thanks !!
pls try Arguments(agent_class=agent, env=env). Recently, elegantrl is updated.
Hey, thanks. I did that, but then I got the following error:
/usr/local/lib/python3.7/dist-packages/finrl/agents/elegantrl/models.py in train_model(self, model, cwd, total_timesteps) 82 model.cwd = cwd 83 model.break_step = total_timesteps ---> 84 train_and_evaluate(model) 85 86 @staticmethod
/usr/local/lib/python3.7/dist-packages/elegantrl/train/run.py in train_and_evaluate(args) 93 cwd = args.cwd 94 break_step = args.break_step ---> 95 horizon_len = args.horizon_len 96 if_allow_break = args.if_allow_break 97 if_off_policy = args.if_off_policy
AttributeError: 'Arguments' object has no attribute 'horizon_len'
Is there a prior version of elegantly that you'd recommend?
pip install git+https://github.com/AI4Finance-LLC/ElegantRL.git@a2207cf
I use this version, you can try it out btw, because of the rapid development of the program, is it necessary to mark the installed version in the tutorial file as in the example above?
pip install git+https://github.com/AI4Finance-LLC/ElegantRL.git@a2207cf
I use this version, you can try it out btw, because of the rapid development of the program, is it necessary to mark the installed version in the tutorial file as in the example above?
This solution didn't perfect for me, I have the same problem, Is someone have another solution that can help me, plz.
Update:
Changing drl_lib to drl_lib = 'stable_baselines3'
seems to do the trick for training cells.
Update: Changing drl_lib to
drl_lib = 'stable_baselines3'
seems to do the trick for training cells.
Sure. Stable_baselines3 does not update much now, so it is more stable for use.
There's a similar issue in FinRL-Meta and you can have a check: https://github.com/AI4Finance-Foundation/FinRL-Meta/issues/202. Although with better performance and more updated construction, ElegantRL is developing rapidly so there might be issues pop up. Stable Baseline3 is a more stable choice like XiaoYang said.
got error when run /FinRL/finrl/train.py FinRL/finrl/agents/elegantrl/models.py", line 63, in get_model model = Arguments(agent_class=agent, env=env) TypeError: init() got an unexpected keyword argument 'agent_class'
thanks for help!
@xtuyaowu elegant is updated frequently recently. pls use pip install git+https://github.com/AI4Finance-LLC/ElegantRL.git@a2207cf or you can try add agent_class.
@zhumingpassional thanks but pip install git+https://github.com/AI4Finance-LLC/ElegantRL.git@a2207cf still fail