Skip to content
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

ActorFixSAC or AgentBase的__init__有bug? #245

Open
flhang opened this issue Jan 2, 2023 · 1 comment
Open

ActorFixSAC or AgentBase的__init__有bug? #245

flhang opened this issue Jan 2, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@flhang
Copy link

flhang commented Jan 2, 2023

  1. 运行 tutorial_LunarLanderContinuous_v2.ipynb 报错:
  2. ElegantRL\elegantrl\agents\AgentBase.py:58, in AgentBase.init(self, net_dim, state_dim, action_dim, gpu_id, args)
    56 cri_class = getattr(self, "cri_class", None)
    57 print(act_class)
    ---> 58 self.act = act_class(net_dim, state_dim, action_dim).to(self.device)
    59 self.cri = cri_class(net_dim, state_dim, action_dim).to(self.device)
    60 if cri_class else self.act
    62 '''optimizer'''

TypeError: init() missing 1 required positional argument: 'action_dim'
3. 看了一下,调用的是 net.py ActorFixSAC 的def init(self, mid_dim, num_layer, state_dim, action_dim):
4. 多了一个参数num_layer, 而且其它地方也没有用, 应该要把这个里删除吧。
5. 我修改AgentBase 的init 总算成功运行了:self.act = act_class(net_dim, self.num_layer, state_dim, action_dim).to(self.device)
self.cri = cri_class(net_dim, self.num_layer, state_dim, action_dim).to(self.device)

@Yonv1943
Copy link
Collaborator

Yonv1943 commented Jan 9, 2023

我提交了这个PR去解决这个问题↓
Fix bug for vec env and agentbase init #248

#248

这个问题是 AgentBase.init() 出现bug 以及 explore_one_env, explore_vec_env 产生冲突引发的。是我们修复bug不够及时,抱歉。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants