I have made a code to solve Atari Breakout. I am facing a little problem, but I can't say what it is.
Here is the code
It is a problem with the replay memory.
try:
next_states = torch.tensor(batch[3], dtype=torch.float32)
except:
import ipdb; ipdb.set_trace()
The problem is located where are those lines. set_trace() is use to pop-up an interactive shell. From there, if I run for i in range(batch_size): print(batch[3][i].shape), I obtained this output
ipdb> for i in range(32): print(batch[3][i].shape)
(4, 84, 84)
(4, 84, 84)
(4, 84, 84)
(4, 84, 84)
(4, 84, 84)
(4, 84, 84)
(4, 84, 84)
(4, 84, 84)
(4, 84, 84)
(4, 84, 84)
(4, 84, 84)
(4, 84, 84)
(4, 84, 84)
(4, 84, 84)
(4, 84, 84)
(4, 84, 84)
(4, 84, 84)
(4, 84, 84)
(4, 84, 84)
(4, 84, 84)
(4, 84, 84)
(4, 84, 84)
(4, 84, 84)
(4, 84, 84)
(4, 84, 84)
(4, 84, 84)
(4, 84, 84)
*** AttributeError: 'NoneType' object has no attribute 'shape'
How can I improve that code to avoid such error?