Giter VIP home page Giter VIP logo

Comments (5)

maximecb avatar maximecb commented on July 24, 2024

Can you paste the assertion that you get?

from minigrid.

RasmusRavnFrost avatar RasmusRavnFrost commented on July 24, 2024

Traceback (most recent call last):
File "C:\Users\Frost\Documents\Dropbox\ITU\KurserITU\Thesis Project\Repository\src\tests\minigrid-obstacles-bug-example.py", line 11, in
observation, reward, done, info = env.step(action)
File "C:\Users\Frost\AppData\Local\Programs\Python\Python36\lib\site-packages\gym_minigrid\envs\dynamicobstacles.py", line 75, in step
self.grid.set(*old_pos, None)
File "C:\Users\Frost\AppData\Local\Programs\Python\Python36\lib\site-packages\gym_minigrid\minigrid.py", line 401, in set
assert i >= 0 and i < self.width
AssertionError

from minigrid.

RasmusRavnFrost avatar RasmusRavnFrost commented on July 24, 2024

I have been trying to figure out whats happening and somehow
one of the obstacles cur_pos has assummed the value [-1, -1] but I don't know why

from minigrid.

RasmusRavnFrost avatar RasmusRavnFrost commented on July 24, 2024

I found the problem:
The agent successfully picked up one of the obstacles (which sets the obstacles current position to [-1, -1])
Then when the obstacle tried to move it realizes that its current position is out of the grid and raises an error.

The obvious fix is to stop allowing the obstacles to be picked up by adding this in
dynamicobstacles.py : DynamicObstaclesEnv.
self.obstacles[i_obst].can_pickup = lambda: False
where the obstacles are created

from minigrid.

maximecb avatar maximecb commented on July 24, 2024

Technically, the bug is on your end, because you're not respecting the action space of the environment, see env.action_space.n.

But, I added a check for invalid actions to prevent more people running into this: f3db6a7

from minigrid.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.