PWhiddy/PokemonRedExperiments

With truncate progress bar instead of overflow error update

Closed this issue · 2 comments

I get an error now from a clean install

/PokemonRedExperiments/baselines/red_gym_env.py", line 355, in make_reward_channel
memoryLcol, rowl = last_pixel * (255 // col_steps)
IndexError: index 39 is out of bounds for axis 0 with size

If I add
if 0 <= col < memory.shape[0] and 0 <= row < memory.shape[1]:
memory[:col, row] = 255
col_covered = col * col_steps
last_pixel = floor(r_val - row_covered - col_covered)
memory[col, row] = last_pixel * (255 // col_steps)
else:
print(f"col or row out of bounds: col={col}, row={row}")
return memory

It runs but I get this popping up

col or row out of bounds: col=39, row=7

Looks like issue #116 was a dupe of this, so also should be fixed by 0ce7fff

Can confirm clean install with this patch #116 resolves it.

Thank you!