Closed Rajesh-Siraskar closed 9 months ago
Hi - Just wanted to mention that in my issue - I do use gymnasium: 0.29.1
, and not gym.
I noticed that a similar Issue was closed today -- Examples Don't work #815 - mentioning that imitation
does not support gym. It is interesting then that I get the same issue, when in fact I use gymnasium.
Code snippet:
import numpy as np
import gymnasium as gym
from imitation.policies.serialize import load_policy
from imitation.util.util import make_vec_env
from imitation.data.wrappers import RolloutInfoWrapper
env = make_vec_env(
"seals:seals/CartPole-v0",
rng=np.random.default_rng(),
post_wrappers=[
lambda env, _: RolloutInfoWrapper(env)
], # needed for computing rollouts later
)
expert = load_policy(
"ppo-huggingface",
organization="HumanCompatibleAI",
env_name="seals/CartPole-v0",
venv=env,
)
I could not reproduce this in imitation==1.0.0
. Feel free to reopen if it persists for you.
Thanks @ernestum - worked like a charm with imitation==1.0.0
!
I tested 3 tutorials and they all work flawlessly now: 1_train_bc.ipynb 2_train_dagger.ipynb 3_train_gail.ipynb
Thanks!
Bug description
Example notebook 1_train_bc.ipynb gives
Namespace not found error
forseals
moduleVersions: Python: 3.9.1, imitation: 0.4.0, seals: 0.2.1,
gymnasium: 0.29.1
Steps to reproduce
Fails to run
env = make_vec_env()
code in the first cell and produces errorNamespaceNotFound: Namespace seals:seals not found. Have you installed the proper package for seals:seals?
Code where error occurs:
Error output:
Environment
3.9.1
pip freeze --all
: