Use RainbowDQN in TRAIN mode to check how the model would behave
Encountered result
Got a KeyError: -1 for self.current_action found in the file rainbow_dqn_agent.py
Steps to reproduce
Open your Game Agent Plugin code
In setup_play, insert self.game_agent.set_mode(1) - 0 is the default, which is equivalent to OBSERVE mode in Rainbow. 1 is for TRAIN.
Run your code
Apparently, the self.current_action variable, which is -1 when RainbowDQN is started, isn't reassigned during the process of choosing an action within the function generate_actions(self, state, **kwargs)
Why this happens, I don't know. Maybe instead of using self.game_agent.mode(1) I should use self.game_agent.mode(RainbowDQNAgentModes.TRAIN).
This reassignment problem doesn't happens with OBSERVE mode, used by default, as one can see in line 160:
Expected result
Use RainbowDQN in TRAIN mode to check how the model would behave
Encountered result
Got a
KeyError: -1
forself.current_action
found in the file rainbow_dqn_agent.pySteps to reproduce
setup_play
, insertself.game_agent.set_mode(1)
- 0 is the default, which is equivalent to OBSERVE mode in Rainbow. 1 is for TRAIN.Apparently, the
self.current_action
variable, which is -1 when RainbowDQN is started, isn't reassigned during the process of choosing an action within the functiongenerate_actions(self, state, **kwargs)
Why this happens, I don't know. Maybe instead of using
self.game_agent.mode(1)
I should useself.game_agent.mode(RainbowDQNAgentModes.TRAIN)
.This reassignment problem doesn't happens with OBSERVE mode, used by default, as one can see in line 160:
This problem can be solved by going to
generate_actions()
function and replacing:for
In the beginning of the RainbowDQNAgent code, one can see this class:
Perhaps we should consider eliminating it and simply exchange
RainbowDQNAgentModes.OBSERVE/TRAIN/EVALUATE
for0/1/2
.