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

Does envpool support class environments written according to the gym standard? #184

Closed
jaried opened this issue Aug 10, 2022 · 4 comments
Closed
Assignees
Labels
question Further information is requested

Comments

@jaried
Copy link

jaried commented Aug 10, 2022

For example, I have an environment called MyEnv, and I use tianshou to run it. Is it correct to call it in the following way?

env=MyEnv()
train_envs = envpool.make(MyEnv, num_envs=args.training_num, env_type="gym")
test_envs = envpool.make(MyEnv, num_envs=args.test_num, env_type="gym")
@Trinkle23897
Copy link
Collaborator

Trinkle23897 commented Aug 10, 2022

You need to write env with C++ interface. See https://envpool.readthedocs.io/en/latest/content/new_env.html

@Trinkle23897 Trinkle23897 added the question Further information is requested label Aug 10, 2022
@jaried
Copy link
Author

jaried commented Aug 10, 2022

Does it not support the environment written in python?

@Trinkle23897
Copy link
Collaborator

Trinkle23897 commented Aug 10, 2022

Current answer is, yes. Every single line of python code requires GIL, which blocks the overall speed of EnvPool. I was trying to propose an API as in #56 but I found it hard to do so.

@jaried
Copy link
Author

jaried commented Aug 10, 2022

I understand. Thanks for your answer.

@jaried jaried closed this as completed Aug 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants