simoninithomas/Deep_reinforcement_learning_Course

[Deep Q Learning with Doom] ValueError: Cannot feed value of shape (64, 84, 84, 4, 260) for Tensor 'DQNetwork/inputs:0', which has shape '(?, 84, 84, 4)'

tyseng92 opened this issue · 5 comments

I have tried to run the script provided in the tutorial in terminal. After the doom windows pop out for a few seconds, the value error appeared. (ValueError: Cannot feed value of shape (64, 84, 84, 4, 260) for Tensor 'DQNetwork/inputs:0', which has shape '(?, 84, 84, 4)')
Platform: Ubuntu 16.04
Tensorflow version: 1.12.0

Here is the output of the error in terminal after the program run failed:

Traceback (most recent call last):
  File "dqdoom.py", line 481, in <module>
    Qs_next_state = sess.run(DQNetwork.output, feed_dict = {DQNetwork.inputs_: next_states_mb})
  File "/home/work-tys/.local/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 929, in run
    run_metadata_ptr)
  File "/home/work-tys/.local/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 1128, in _run
    str(subfeed_t.get_shape())))
ValueError: Cannot feed value of shape (64, 84, 84, 4, 260) for Tensor 'DQNetwork/inputs:0', which has shape '(?, 84, 84, 4)'

How to modify the dimension of next_states_mb in order to fit the array required by the DQNetwork.inputs?

I'm having the same issue, were you able to figure out a solution?

I'm having the same issue, were you able to figure out a solution?

No, haven't found a solution for this problem.

The Screen format in vizdoom isn't grayscale. the default value is CRCGCB..
You have to import ScreenFormat from vizdoom and type this when creating the environment :
game.set_screen_format(ScreenFormat.GRAY8)

game.set_screen_format(ScreenFormat.GRAY8)

can you please send the snippet of code of how to use this line in the code?

game.set_screen_format(ScreenFormat.GRAY8)

can you please send the snippet of code of how to use this line in the code?

You can add that line of code in the create_environment function, right before game.init()

Alternatively, you could change the basic.cfg file, and change the line
screen_format = CRCGCB to screen_format = GRAY8
(Which is what I did first before I found the method above)