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

Added some basic gym env registration #310

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

shyamsn97
Copy link

Thought I'd take a stab at #297

Added some simple registration of sm.Scene objects with sm.RLEnv

scene = sm.Scene() # this could also be loaded in
sm.RLEnv.register("SimulateLunarLander-v0", scene, frame_skip=1)
env = gym.make("SimulateLunarLander-v0")

Right now it just uses the initial scene object, but maybe it should copy it before.

Let me know if this is useful! @natolambert

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint.

@natolambert
Copy link
Contributor

Hi @shyamsn97 ! This is a great start. Sorry for the delay, I'm wrapping my head around if we want to do this in specific examples, have a general API, or just include it in the docs.

Happy to hear any thoughts from the community, and I'll write up my thoughts soon too.

@shyamsn97
Copy link
Author

Hey, thanks for reviewing! Sorry it’s failing, will fix that soon. Also yeah I think having a general api for registering envs makes sense because if a user wanted to write their own registration method it’s not too straightforward (normally I’d pass Scene into the registration kwargs, but it fails because socket can’t be pickled). But I also see how including a small snippet in the docs could work

@natolambert
Copy link
Contributor

Yeah I'm happy to have it in multiple places for now. Two that seem most specific are in the rl examples or in the docs under advanced usage. Happy to answer specifics on how to do this.

I'm thinking add a new example so it's easier to find!

@natolambert
Copy link
Contributor

Ah the tests seem to be failing because of gym I can think about this.

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

Successfully merging this pull request may close these issues.

3 participants