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
TypeError: __init__() missing 1 required positional argument: 'action_dim' #237
Comments
The code in ElegantRL/elegantrl/agents/net.py Line 381 in f0f518e
The code in ElegantRL/elegantrl/agents/AgentBase.py Line 53 in f0f518e
The code in
I will upload a Pullrequest 237 to fix this bug. Thank you. |
same question, please fix it and merge to master as soon as possible |
self.act = act_class(net_dim, state_dim, action_dim).to(self.device) this is still in the latest code. It still crashes for me |
easy to reproduce by running the sample notebook https://github.com/AI4Finance-Foundation/FinRL/blob/master/tutorials/3-Practical/FinRL_MultiCrypto_Trading.ipynb |
If you run your own example, errors will be reported. Please help us to find out what the problem is?
/opt/anaconda3/envs/elegant_RL/bin/python /home/lhs/PycharmProjects/elegant_RL/tutorial_BipedalWalker-v3.py
WARNING: env.action_space.high [1. 1. 1. 1.]
env_args = {
'env_num': 1,
'env_name': 'BipedalWalker-v3',
'max_step': 1600,
'state_dim': 24,
'action_dim': 4,
'if_discrete': False,
'target_return': 300,
}
| Arguments Remove cwd: ./BipedalWalker-v3_PPO_0
Traceback (most recent call last):
File "/home/lhs/PycharmProjects/elegant_RL/tutorial_BipedalWalker-v3.py", line 32, in
train_and_evaluate(args)
File "/opt/anaconda3/envs/elegant_RL/lib/python3.8/site-packages/elegantrl/train/run.py", line 87, in train_and_evaluate
agent = init_agent(args, gpu_id, env)
File "/opt/anaconda3/envs/elegant_RL/lib/python3.8/site-packages/elegantrl/train/run.py", line 16, in init_agent
agent = args.agent_class(args.net_dim, args.state_dim, args.action_dim, gpu_id=gpu_id, args=args)
File "/opt/anaconda3/envs/elegant_RL/lib/python3.8/site-packages/elegantrl/agents/AgentPPO.py", line 38, in init
AgentBase.init(self, net_dim, state_dim, action_dim, gpu_id, args)
File "/opt/anaconda3/envs/elegant_RL/lib/python3.8/site-packages/elegantrl/agents/AgentBase.py", line 53, in init
self.act = act_class(net_dim, state_dim, action_dim).to(self.device)
TypeError: init() missing 1 required positional argument: 'action_dim'
The text was updated successfully, but these errors were encountered: