AI4Finance-Foundation / ElegantRL

Massively Parallel Deep Reinforcement Learning. 🔥
https://ai4finance.org
Other
3.66k stars 842 forks source link

get error message "TypeError: __init__() got an unexpected keyword argument 'if_off_policy'" #62

Open larryzh opened 2 years ago

larryzh commented 2 years ago

get error message "TypeError: init() got an unexpected keyword argument 'if_off_policy'" when I try to run eRL_demo_StockTrading.ipynb

Yonv1943 commented 2 years ago

add args.if_off_policy=False if you use on-policy algorithms (PPO, A2C) will fix this bug. add args.if_off_policy=True if you use other DRL algorithms.

We add the a function to automatically set this value, see: https://github.com/AI4Finance-Foundation/ElegantRL/blob/a89aa4f022a151109abc301c78829056710b37d4/elegantrl/train/config.py#L89-L91