I'm currently working on a reinforcement learning model, and have come across an issue while trying to create a DQN to work within my custom environment.
While instantiating the DQN agent with this line:
dqn = DQNAgent(model=model, memory=memory, policy=policy,
nb_actions=(None,actions), nb_steps_warmup=10, target_model_update=1e-2)
Note that actions = 3 (integer).
I get the error code:
raise ValueError(f'Model output "{model.output}" has invalid shape. DQN expects a model that has one dimension for each action, in this case {self.nb_actions}.')
ValueError: Model output "Tensor("dense_2/BiasAdd:0", shape=(?, 3), dtype=float32)" has invalid shape. DQN expects a model that has one dimension for each action, in this case 3
After digging into the DQN files, I noticed that the error is arising by the fact that
(?,3) != (None,3)
From my understanding the question mark is simply a placeholder to represent an unknown amount of data points. So why does it have a problem with None not being equal to it and how do I fix this?
Thanks