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

[Question] DQN doesn't support vectorize environment #395

Closed
1 of 2 tasks
Ann-eat-apple opened this issue Apr 15, 2021 · 3 comments
Closed
1 of 2 tasks

[Question] DQN doesn't support vectorize environment #395

Ann-eat-apple opened this issue Apr 15, 2021 · 3 comments
Labels
duplicate This issue or pull request already exists more information needed Please fill the issue template completely question Further information is requested

Comments

@Ann-eat-apple
Copy link

Ann-eat-apple commented Apr 15, 2021

Important Note: We do not do technical support, nor consulting and don't answer personal questions per email.
Please post your question on the RL Discord, Reddit or Stack Overflow in that case.

Question

Why does DQN doesn't support vecotrize environment of 1?

import pettingzoo.atari.pong_v1 as pong_v1
import supersuit as ss
from stable_baselines3 import DQN
env = pong_v1.parallel_env(full_action_space=False)
env = ss.color_reduction_v0(env, mode='full')
env = ss.resize_v0(env, x_size=64m y_size=64)
env = ss.frame_stack_v1(env, 3)
env = ss.pettingzoo_env_to_vec_env_v0(env)
env = ss.concat_vec_envs_v0(env, 1, num_cpus=4, base_class='stable_baselines3')
model = DQN('CnnPolicy', env, verbose=1)

Your question. This can be e.g. questions regarding confusing or unclear behaviour of functions or a question if X can be done using stable-baselines3. Make sure to check out the documentation first.

Additional context

Add any other context about the question here.

Checklist

  • I have read the documentation (required)
  • I have checked that there is no similar issue in the repo (required)
@Ann-eat-apple Ann-eat-apple added the question Further information is requested label Apr 15, 2021
@araffin araffin added the more information needed Please fill the issue template completely label Apr 15, 2021
@araffin
Copy link
Member

araffin commented Apr 15, 2021

Why does DQN doesn't support vecotrize environment of 1?

env = ss.concat_vec_envs_v0(env, 1, num_cpus=4, base_class='stable_baselines3')

it seems you are using 4 envs, no? (@justinkterry should probably know as author of super suit)
and please fill the issue template completely (including traceback)

@jkterry1
Copy link
Contributor

I explained this in the related issue here: Farama-Foundation/SuperSuit#77

The number of envs are equal to the number of players in pong (two).

The feature request for DQN to support vectorized environments still stands though, I assume.

@araffin
Copy link
Member

araffin commented Apr 15, 2021

Thanks for the quick answer =)

The feature request for DQN to support vectorized environments still stands though, I assume.

I will close this issue as a duplicate of #179

@araffin araffin closed this as completed Apr 15, 2021
@araffin araffin added the duplicate This issue or pull request already exists label Apr 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists more information needed Please fill the issue template completely question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants