keiohta / tf2rl

TensorFlow2 Reinforcement Learning
MIT License
461 stars 104 forks source link

"TypeError: 'range' object cannot be interpreted as an integer" when attempting to use the __call__() method of IRLTrainer #159

Open peteris-racinskis opened 2 years ago

peteris-racinskis commented 2 years ago

Caused by a duplicate range() call in experiments/irl_trainer.py.

On line 71: self._random_range = range(expert_obs.shape[0])

Then on line 150: indices = random.sample(range(self._random_range), self._irl.batch_size)

Removing this duplicate call resolved the issue for me. As far as I can tell this looks like a bug, as line 150 is the only reference to _random_range.