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

state的形式 #185

Open
silkyrose opened this issue Oct 19, 2020 · 1 comment
Open

state的形式 #185

silkyrose opened this issue Oct 19, 2020 · 1 comment

Comments

@silkyrose
Copy link

silkyrose commented Oct 19, 2020

Hi 博主,
我的state是一个列表,初始值为[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],选择action时出错:TypeError: tuple indices must be integers or slices, not tuple
我认为state已经是(1, size_of_observation)形式了,就注释掉了,observation = observation[np.newaxis, :]
结果还是报错:
Before call eo.attach
action_value = self.sess.run(self.q_eval, feed_dict={self.s:observation})
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 929, in run
run_metadata_ptr)
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1128, in _run
str(subfeed_t.get_shape())))
ValueError: Cannot feed value of shape (15,) for Tensor 's:0', which has shape '(?, 5)'
有哪位已经跑过代码的大侠也来说说,谢谢!

@silkyrose
Copy link
Author

silkyrose commented Oct 19, 2020

n_features是什么含义
原因是DoubleDQN 当中n_features 和 n_actions不能被初始化代码初始化。
后来干脆直接写在了self里面

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

1 participant