gym-carla
gym-carla copied to clipboard
Run without rendering in pygame window
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!
@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
@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 isFile "/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?
I updated pygame to version 2.0.1 and ran test.py, the error do not appear. It is amazing.
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/
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.
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?