simoninithomas / Deep_reinforcement_learning_Course

Implementations from the free course Deep Reinforcement Learning with Tensorflow and PyTorch
http://www.simoninithomas.com/deep-rl-course
3.74k stars 1.23k forks source link

Deep Q learning with Doom, last part #22

Open meguvegu opened 5 years ago

meguvegu commented 5 years ago

I tried testing the code and it crashes after the 500 episodes of training from the last part. For state = stack_frames(stacked_frames, frame) did you forget a True or False at the end? And possibly the LHS should be state, stacked_frames too?

Traceback (most recent call last): File "Deep Q-learning with Doom.py", line 530, in state = stack_frames(stacked_frames, frame) TypeError: stack_frames() missing 1 required positional argument: 'is_new_episode'

Unsure about the LHS, but I tried both True and False myself. But it then crashes on the next line too.

Traceback (most recent call last): File "Deep Q-learning with Doom.py", line 532, in Qs = sess.run(DQNetwork.output, feeddict = {DQNetwork.inputs: state.reshape((1, *state.shape))}) AttributeError: 'tuple' object has no attribute 'reshape'

I converted the .ipynb to one python file first. Hope that didn't cause any problems.

AbhishekAndriod123 commented 5 years ago

the function returns a tuple of stacked_frames and stacked_state. Run the following: state, stacked_state = stack_frames(stacked_frames, state, True)