Randint problem when loading racetrack environment
Agathe48 opened this issue · comments
I notice there was sometimes a bug when loading the racetrack environment, the following error was shown:
File highway_env\road\road.py", line 254, in random_lane_index
_id = np_random.randint(len(self.graph[_from][_to]))
AttributeError: 'numpy.random._generator.Generator' object has no attribute 'randint'
I managed to fix it in my local environment by changing this line in the file: highway_env\road\road.py", line 254, in random_lane_index
I change the line _id = np_random.randint(len(self.graph[_from][_to]))
to _id = np_random.integers(len(self.graph[_from][_to]))
.
I don't know if it's the best way to fix this bug but it works for me.