Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I came across this bug from gym: openai/gym#2752
When time limit is triggered, the output is a bool instead of a dict like {'player_0': False, 'player_1': False}
This produces the following error randomly. It appears sooner or later during the training.
~/.conda/envs/lux_ai_s2/lib/python3.7/site-packages/gym/wrappers/time_limit.py in step(self, action)
16 self._elapsed_steps is not None
17 ), "Cannot call env.step() before calling reset()"
---> 18 observation, reward, done, info = self.env.step(action)
19 self._elapsed_steps += 1
20 if self._elapsed_steps >= self._max_episode_steps:
/tmp/ipykernel_13436/3060603165.py in step(self, action)
57 obs, _, done, info = self.env.step(action)
58 obs = obs[agent]
---> 59 done = done[agent]
60 # if type(done) == type({}): done = done[agent]
61 # elif type(done) == type(True): done = {agent: done, opp_agent: False}
TypeError: 'bool' object is not subscriptable
I sugest this patch to avoid that.