Skip to content

Env not unwrappable to BaseWorldModelWrapper #50

@kierad

Description

@kierad

Hello, thanks for sharing your code. I'm having trouble running generate_expert_data.py. Here's what I'm trying:

  • conda create --name irl-benchmark python=3.8 (The readme says 3.6, but 3.8 seems to be the oldest Python version supported by Conda right now).
  • source activate irl-benchmark
  • pip install -r requirements.txt
  • python generate_expert_data.py which raises this error:
Traceback (most recent call last):
  File "generate_expert_data.py", line 20, in <module>
    expert_agent = rl_alg_factory(env)
  File "generate_expert_data.py", line 17, in rl_alg_factory
    return ValueIteration(env, {'gamma': 0.9})
  File "/Users/kieradavidson/Documents/GitHub/irl-benchmark/irl_benchmark/rl/algorithms/value_iteration.py", line 31, in __init__
    assert is_unwrappable_to(env, BaseWorldModelWrapper)
AssertionError

Adding print(env) gives this: <FrozenLakeFeatureWrapper<TimeLimit<FrozenLakeEnv<FrozenLake-v0>>>>

(And unsurprisingly, removing the assertion leads to another error:

Traceback (most recent call last):
  File "generate_expert_data.py", line 20, in <module>
    expert_agent = rl_alg_factory(env)
  File "generate_expert_data.py", line 17, in rl_alg_factory
    return ValueIteration(env, {'gamma': 0.9})
  File "/Users/kieradavidson/Documents/GitHub/irl-benchmark/irl_benchmark/rl/algorithms/value_iteration.py", line 35, in __init__
    self.model_wrapper = unwrap_env(env, BaseWorldModelWrapper)
  File "/Users/kieradavidson/Documents/GitHub/irl-benchmark/irl_benchmark/utils/wrapper.py", line 23, in unwrap_env
    raise ValueError(
ValueError: Unwrapping env did not yield an instance of class <class 'irl_benchmark.rl.model.model_wrapper.BaseWorldModelWrapper'>

)

Could you point me in the right direction? Thank you.

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