Open HarryLukKF opened 2 years ago
same here!
Also encountered this issue when running Demo_MultiCrypto_Trading.ipynb I spent quite a long time debugging it and finally got it working by changing these things:
elegantrl/agents/AgentBase.py line 43, insert:
self.traj_list = [
[list() for _ in range(4 if self.if_off_policy else 5)]
for _ in range(self.env_num)
]
elegantrl/agents/AgentPPO.py line 88, change to:
return self.convert_trajectory(traj_list, last_done), step_i
elegantrl/train/evaluator.py line 60, comment it out
finrl-meta/agents/elegantrl_models.py line 112, change to:
environment.cash
finrl-meta/agents/elegantrl_models.py line 114 change to:
environment.price_array[environment.time] * environment.stocks
Also encountered this issue when running Demo_MultiCrypto_Trading.ipynb I spent quite a long time debugging it and finally got it working by changing these things:
- elegantrl/agents/AgentBase.py line 43, insert:
self.traj_list = [ [list() for _ in range(4 if self.if_off_policy else 5)] for _ in range(self.env_num) ]
- elegantrl/agents/AgentPPO.py line 88, change to:
return self.convert_trajectory(traj_list, last_done), step_i
- elegantrl/train/evaluator.py line 60, comment it out
- finrl-meta/agents/elegantrl_models.py line 112, change to:
environment.cash
- finrl-meta/agents/elegantrl_models.py line 114 change to:
environment.price_array[environment.time] * environment.stocks
Thanks Alex. Wondering if you tried run it on Colab?
Also encountered this issue when running Demo_MultiCrypto_Trading.ipynb I spent quite a long time debugging it and finally got it working by changing these things:
- elegantrl/agents/AgentBase.py line 43, insert:
self.traj_list = [ [list() for _ in range(4 if self.if_off_policy else 5)] for _ in range(self.env_num) ]
- elegantrl/agents/AgentPPO.py line 88, change to:
return self.convert_trajectory(traj_list, last_done), step_i
- elegantrl/train/evaluator.py line 60, comment it out
- finrl-meta/agents/elegantrl_models.py line 112, change to:
environment.cash
- finrl-meta/agents/elegantrl_models.py line 114 change to:
environment.price_array[environment.time] * environment.stocks
Thanks Alex. Wondering if you tried run it on Colab?
Yes, I am getting the same error both on ubuntu and google Colab
Same problem here! Solution mentioned by @AlexLiddiard solved the issue. But why it hasn't been fixed yet on elegantrl?!
Also, if when I try other agents like ddpg or td3 or sac, I get another error in the same line saying that init() expects 4 arguments but got 5. I spent a couple of hours trying to debug it but no luck. Anyone has any ideas?
I modified the question related to 'traj_list'. The file ' demo_A2C_PPO.py ' and ' demo_PPO_H.py ' could run correctly now!
By the way, demo_DDPG_TD3_SAC.py and demo_DDPG_H.py run correctly as well~
There is an error when I try to excute the train function in Demo_MultiCrypto_Trading.ipynb
AttributeError: 'AgentPPO' object has no attribute 'traj_list'
Please kindly advise how should I fix this error? Many thanks in advance