irl-imitation
irl-imitation copied to clipboard
IndexError: only integers, slices (`:`), ellipsis (`...`), numpy.newaxis (`None`) and integer or boolean arrays are valid indices
\irl-imitation\mdp\gridworld.py", line 151, in get_transition_states_and_probs
nei_s[1] < 0 or nei_s[1] >= self.width or self.grid[nei_s[0]][nei_s[1]] == 'x':
IndexError: only integers, slices (:
), ellipsis (...
), numpy.newaxis (None
) and integer or boolean arrays are valid indices
check your python version, it should be use python2
check your python version, it should be use python2
Is there any difference in this case? I solved this problem but is show another problem which is sj will bigger than 25..
I solved by updating the function below in gridworld.py (I'm using python 3):
def idx2pos(self, idx): """ input: 1d idx returns: 2d column-major position """ return (idx % self.height, int(idx / self.height))