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

[Bug Report] Cannot decode obs['image'] because of no implementation of agent in minigrid/core/world_object.py #422

Open
1 task done
EC2EZ4RD opened this issue Feb 29, 2024 · 0 comments

Comments

@EC2EZ4RD
Copy link

EC2EZ4RD commented Feb 29, 2024

  • Bug description
    Cannot decode obs['image'] because of no implementation of agent in minigrid/core/world_object.py

  • Code

First, create an environment

import gymnasium as gym
from minigrid.wrappers import FullyObsWrapper
env = gym.make("MiniGrid-Empty-5x5-v0")
env = FullyObsWrapper(env)
obs, _ = env.reset()

Then, run

env.grid.decode(obs['image'])[0].render(env.tile_size, [0,0])

and return error:

File [~/miniconda3/envs/minigrid/lib/python3.10/site-packages/minigrid/core/world_object.py:101] in WorldObj.decode(type_idx, color_idx, state)
     99     v = Lava()
    100 else:
--> 101     assert False, "unknown object type in decode '%s'" % obj_type
    103 return v
  • Solution
    Should add the render code of agent in minigrid/core/world_object.py

Checklist

  • I have checked that there is no similar issue in the repo (required)
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