Giter Site home page Giter Site logo

Comments (10)

araffin avatar araffin commented on September 16, 2024

Hello,
Thanks for reporting the issue.
Could you please follow the issue template and provide a minimal yet complete code to reproduce the error?

from stable-baselines.

Guilherme-B avatar Guilherme-B commented on September 16, 2024

Hi @araffin ,

Updated the main topic to your request. Sorry.

from stable-baselines.

araffin avatar araffin commented on September 16, 2024

Hello,
Thanks for the update.
I suspect your issue is related to this one: openai/gym#1191
What is your gym version?

from stable-baselines.

Guilherme-B avatar Guilherme-B commented on September 16, 2024

Hi again!

My gym version is: 0.10.5

I tried printing the shape upon env creation and on dummy_vec_env, just one line before the place where the error is thrown, and they output the same shape, but inline with the bug you identified:

Original shape: ((2, 2),)
Env: ((2, 2),)

Hsa the new version fixed it?

from stable-baselines.

araffin avatar araffin commented on September 16, 2024

Are you sure you are using 0.10.5? Did you install it with pip?
On my computer, the following code raises an error (with this gym version):

spaces.MultiDiscrete([[0, 12], [0, 250]])

AssertionError: nvec should be a 1d array (or list) of ints

What you want to do is:

spaces.MultiDiscrete([12, 250])

no ? (12 and 250 discrete actions)

from stable-baselines.

Guilherme-B avatar Guilherme-B commented on September 16, 2024

That's strange, yes I installed it via Pip and it is definitely 0.10.5.
I never got an error, it is how the Hands‑On Intelligent Agents with OpenAI Gym book defines the space is to be used, but, I have changed it to your recommendation (although I'm working with an observation space, not an action space but I take it its the same), and the problem persists, exactly as before.

from stable-baselines.

araffin avatar araffin commented on September 16, 2024

I never got an error

I created a colab notebook so you can reproduce the error (with gym 0.10.5): https://colab.research.google.com/drive/1KDWriJMxBv8rtqjvGEu6Qz9bzZvtKt-B

With the latest version of gym (0.10.8), there is no error but the shape is changed (and that causes the error in the vec env): https://colab.research.google.com/drive/1oDOxpECm5mU-joHy_lnLwPGBQkgTaHCh

I have changed it to your recommendation

If you don't have any error with your original, then my recommendation won't work anyway.

from stable-baselines.

Guilherme-B avatar Guilherme-B commented on September 16, 2024

Ah I see.

Should I then use an older gym version before the shape is changed?

from stable-baselines.

araffin avatar araffin commented on September 16, 2024

Yes,
I would recommend using 0.10.5 (with my recommendation for declaring the space).
I am waiting for OpenAI answer. If breaking things (i.e. no backward compatibility) is what they wanted, we will have to patch stable-baselines, otherwise, we will wait for a fix from gym.

from stable-baselines.

Guilherme-B avatar Guilherme-B commented on September 16, 2024

You are right.

All fixed up, thank you for your help. Hopefully they will fix their end soon enough.
Now to get SubprocEnv working, which seems to not work. I'll run some more testing and open a new issue if needed.

Once again, thank you.

from stable-baselines.

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.