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

关于open AI gym运行报错 #206

Open
Jackmeory opened this issue Sep 17, 2022 · 2 comments
Open

关于open AI gym运行报错 #206

Jackmeory opened this issue Sep 17, 2022 · 2 comments

Comments

@Jackmeory
Copy link

我下载了DQN的代码,发现运行报错,主要错误在两个地方上
1.choose_action(self, observation):
observation = observation[np.newaxis, :]出现错误为TypeError: tuple indices must be integers or slices, not tuple
2.在修改了第一部分的错误之后(通过课程讨论区一位朋友提供的想法先observation=np.array(observation)然后再进行reshape,发现在transition部分又出现错误,提示输入的transition和self.memory列数不同,在进行observation的打印之后发现它的格式很奇怪,是(array([ 0.00107828, -0.02266533, -0.03175206, -0.04841794], dtype=float32), {})
这样的一个形式,和observation_的形式也不同,我又回去check了maze的observation和observation_的形式发现maze的是相同,不知道该如何修改RL_brain的代码,希望大神们能给点建议

@QiangWong007
Copy link

老兄,我和你遇到的是一样的问题,请问你的解决了吗?

@PPCINUST
Copy link

env.reset 的格式会有问题改为:
observation = env.reset()[0]
env.step 会返回五个变量,有一个是执行概率 可以改为:
observation_, reward, done, info, pro = env.step(action)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants