Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AssertionError: The observation returned by the reset() method is not contained with the observation space #2

Open
JunzWu opened this issue Jul 11, 2022 · 0 comments

Comments

@JunzWu
Copy link

JunzWu commented Jul 11, 2022

Hi, I meet this error when I try to run this command:"python train.py --algo sr --env MiniGrid-Empty-6x6-v0 --input image --frames 100000 --seed 1 --lr 0.001 --recon-loss-coef 5 --entropy-coef 0.005 --feature-learn curiosity --target-update 100“. Could you help me with this error?

File "train.py", line 230, in
args.optim_alpha, args.optim_eps, args.memory_cap, args.batch_size, preprocess_obss)
File "/home/junz/Desktop/successor-features-A2C/algos/sr_a2c.py", line 19, in init
super().init(envs, model, target, device, num_frames_per_proc, discount, lr_feature, gae_lambda, max_grad_norm, recurrence, memory_cap, preprocess_obss, reshape_reward)
File "/home/junz/Desktop/successor-features-A2C/algos/baseSR.py", line 96, in init
self.obs = self.env.reset()
File "/home/junz/anaconda3/envs/SF/lib/python3.7/site-packages/torch_ac/utils/penv.py", line 40, in reset
results = [self.envs[0].reset()] + [local.recv() for local in self.locals]
File "/home/junz/anaconda3/envs/SF/lib/python3.7/site-packages/gym/wrappers/order_enforcing.py", line 42, in reset
return self.env.reset(**kwargs)
File "/home/junz/anaconda3/envs/SF/lib/python3.7/site-packages/gym/wrappers/env_checker.py", line 47, in reset
return passive_env_reset_check(self.env, **kwargs)
File "/home/junz/anaconda3/envs/SF/lib/python3.7/site-packages/gym/utils/passive_env_checker.py", line 247, in passive_env_reset_check
_check_obs(obs, env.observation_space, "reset")
File "/home/junz/anaconda3/envs/SF/lib/python3.7/site-packages/gym/utils/passive_env_checker.py", line 115, in _check_obs
), f"{pre} is not contained with the observation space ({observation_space})"
AssertionError: The observation returned by the reset() method is not contained with the observation space (Dict(image: Box(0, 255, (7, 7, 3), uint8)))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant