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

Run without rendering in pygame window #25

Open
anahrendra opened this issue Sep 22, 2020 · 6 comments
Open

Run without rendering in pygame window #25

anahrendra opened this issue Sep 22, 2020 · 6 comments

Comments

@anahrendra
Copy link

Can I run the simulator without rendering the display, just as what we can do in MuJoCo Gym. Because I need to run the code in a server computer with no display. Thanks in advance!

@kargarisaac
Copy link

@aswinnahrendra Did you find a way for this?
I usually use os.environ["SDL_VIDEODRIVER"] = "dummy" at the beginning of my codes to turn off the pygame window, but for this environment, when I do it, in the code I face some errors. It seems it is not a solution for this environment. The error is

File "/home/isaac/codes/autonomous_driving/gym-carla/gym_carla/envs/carla_env.py", line 849, in _get_obs
    pygame.surfarray.blit_array(camera_surface, camera_display)
  File "/home/isaac/miniconda3/envs/rlpyt/lib/python3.7/site-packages/pygame/surfarray.py", line 81, in blit_array
    return numpysf.blit_array (surface, array)
  File "/home/isaac/miniconda3/envs/rlpyt/lib/python3.7/site-packages/pygame/_numpysurfarray.py", line 82, in blit_array
    return array_to_surface(surface, array)
ValueError: unsupported datatype for array

@dotzou
Copy link

dotzou commented Mar 10, 2021

@aswinnahrendra Did you find a way for this?
I usually use os.environ["SDL_VIDEODRIVER"] = "dummy" at the beginning of my codes to turn off the pygame window, but for this environment, when I do it, in the code I face some errors. It seems it is not a solution for this environment. The error is

File "/home/isaac/codes/autonomous_driving/gym-carla/gym_carla/envs/carla_env.py", line 849, in _get_obs
    pygame.surfarray.blit_array(camera_surface, camera_display)
  File "/home/isaac/miniconda3/envs/rlpyt/lib/python3.7/site-packages/pygame/surfarray.py", line 81, in blit_array
    return numpysf.blit_array (surface, array)
  File "/home/isaac/miniconda3/envs/rlpyt/lib/python3.7/site-packages/pygame/_numpysurfarray.py", line 82, in blit_array
    return array_to_surface(surface, array)
ValueError: unsupported datatype for array

Yes, I meet the same error. Did you solve this error in the headless server?

@dotzou
Copy link

dotzou commented Mar 10, 2021

I updated pygame to version 2.0.1 and ran test.py, the error do not appear. It is amazing.

@kargarisaac
Copy link

I updated pygame to version 2.0.1 and ran test.py, the error do not appear. It is amazing.

I removed pygame dependency and used this library instead:

https://pypi.org/project/carla-birdeye-view/

@dotzou
Copy link

dotzou commented Mar 11, 2021

I updated pygame to version 2.0.1 and ran test.py, the error do not appear. It is amazing.

I removed pygame dependency and used this library instead:

https://pypi.org/project/carla-birdeye-view/

Thanks for your sharing, It is a good solution.

@Zhephy
Copy link

Zhephy commented Nov 17, 2023

I updated pygame to version 2.0.1 and ran test.py, the error do not appear. It is amazing.

Thanks for your advice. After upgrading pygame can the model training be done normally?
Do new problems occur due to pygame version mismatch?

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

No branches or pull requests

4 participants