Reinforcement-learning-with-tensorflow icon indicating copy to clipboard operation
Reinforcement-learning-with-tensorflow copied to clipboard

state的形式

Open silkyrose opened this issue 5 years ago • 1 comments

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 avatar Oct 19 '20 07:10 silkyrose

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

silkyrose avatar Oct 19 '20 08:10 silkyrose