Skip to content

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

@peteris-racinskis

Description

@peteris-racinskis

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions