Git Product home page Git Product logo

Comments (8)

maximecb avatar maximecb commented on June 17, 2024

Hi Chase. I think this is an issue related to the PyQT renderer. Can you provide a code snippet to reproduce the issue?

from minigrid.

chasebos91 avatar chasebos91 commented on June 17, 2024

Hey thanks for the quick response. Here's where I've instantiated multiple envs:

import gym
from gym_minigrid.wrappers import RGBImgObsWrapper
from PEARL import PEARL

env0 = RGBImgObsWrapper(gym.make("MiniGrid-Empty-Random-5x5-v0"))
env00 = RGBImgObsWrapper(gym.make("MiniGrid-FourRooms-v0"))
env1 = RGBImgObsWrapper(gym.make("MiniGrid-MultiRoom-N2-S4-v0"))
env2 = RGBImgObsWrapper(gym.make("MiniGrid-MultiRoom-N4-S5-v0"))
train_tasks = [env00, env0, env1, env2]
test_env = RGBImgObsWrapper(gym.make("MiniGrid-MultiRoom-N6-v0"))
test_tasks = [test_env]
#train
pearl = PEARL(train_tasks[0], train_tasks, test_tasks)
pearl.train_algo()

#########################################################################

And here's where I'm rendering each environment to initialize them into replay buffers:

def get_path(self, env, policy, max_length):
           ...
	s = env.reset()
	env.render()
	for i in range(max_length):
		a = policy.get_action(s)
		a = self.return_action(env, a)
		s_p, r, t, e_info = env.step(a)
                   ... # the line above breaks it

########################################################################

Thanks again for looking into it. I'll look up the issue in ref to PyQT in the meantime.

from minigrid.

maximecb avatar maximecb commented on June 17, 2024

One temporary fix that could work is to run the environments in forked processes.

Otherwise though, next week I will start looking at implementing a renderer based on NumPy (see #76). I would ideally like to eliminate the PyQT dependency. You're not the only one to run into issues. If you're available to help me test next week that could he useful :)

from minigrid.

chasebos91 avatar chasebos91 commented on June 17, 2024

Hey, thanks that's awesome. I'd be happy to help, though I'm working on the implementation so it will definitely not be bug-free. If it's still helpful though, that would be great!

from minigrid.

maximecb avatar maximecb commented on June 17, 2024

Hi @chasebos91. I have the new version of MiniGrid that uses NumPy to produce graphics on a new branch maximecb-numpy-render, and matplotlib for rendering windows. Could you test it out and let me know if it fixes the problem you encountered or if you run into any other issues?

from minigrid.

chasebos91 avatar chasebos91 commented on June 17, 2024

So far so good! Will let you know as I keep working on it. Thank you!!
** EDIT: Sorry nvm I'm a GitHub noob, can you tell me how I can access the branch?

from minigrid.

maximecb avatar maximecb commented on June 17, 2024

You can access it by first doing a git pull, then:

git checkout maximecb-numpy-render`

Then to install the package in editable mode:

pip3 install -e .

from minigrid.

maximecb avatar maximecb commented on June 17, 2024

This is now pushed to the master branch as well :)

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.