Closed feliperafael closed 1 year ago
"SonicTheHedgehog-Genesis.GreenHillZone.Act1"
This isn't a legal Gym ID that gym.make
recognizes. I'm not familiar with Retro, does it add the games to the Gym registry? If so, look up what those IDs are. Otherwise, you can either register the entrypoint yourself using gym.register
, or just avoid using env names at all and mod our util.make_vec_env
to call retro_contest.local.make
IMO the main problem here is that rollout.rollout
is getting a (h,w,c)-formatted environment, but SB3 training transposes environments internally to (c,h,w) format before feeding them to the policy. One thing that would work:
rollouts = rollout.rollout(
expert,
expert.get_env(),
rollout.make_sample_until(min_timesteps=None, min_episodes=6),
)
The obvious problem is that this doesn't wrap the environment the way you want. One solution would be to just explicitly write something like
new_env = RolloutInfoWrapper(expert.get_env())
rollouts = rollout.rollout(
expert,
new_env,
rollout.make_sample_until(min_timesteps=None, min_episodes=6),
)
The next problem is that maybe if you do this you won't get a vectorized environment? But there's probably some similar way of fixing that.
I guess not the "main" problem in that it's not causing your error, but I think it would cause an error once you applied Adam's fix.
You'll also need to feed an rng into rollout.rollout
I agree we should give an example of how to do the rollouts somewhere, maybe in the CNN tutorial.
We should probably also prominently warn people in the docs that SB3 and imitation
are using different conventions here.
Doesn't seem like this is an imitation issue, and the usability side of things is already covered in https://github.com/HumanCompatibleAI/imitation/issues/599 so closing in favor of that issue.
Please do feel free to open a new issue if you discover a bug in any of our implementations.
I'm trying to apply GAIL using retroEnv "SonicTheHedgehog-Genesis" but I'm getting some errors. Apparently, the env is not recognized. Does anyone have any idea what could be causing this?
below the code I'm trying to do to generate the rollouts and the error I'm getting
Environment