Farama-Foundation / HighwayEnv

A minimalist environment for decision-making in autonomous driving
https://highway-env.farama.org/
MIT License
2.56k stars 732 forks source link

Video Record Error! #298

Closed Phd-Ma closed 2 years ago

Phd-Ma commented 2 years ago

hello, Mr eleurent:

My development environment configuration is as follows:

python 3.7.13 pip install highway-env==1.5 gym==0.21 pygame==2.1.2 pip install tensorflow-gpu==1.15 pip install git+https://github.com/DLR-RM/stable-baselines3

However, when I execute the script /highway-env/scripts/sb3_highway_dqn.py, the prompt error is: Fatal Python error: (pygame parachute) Segmentation Fault Can you tell me how to troubleshoot the problem!

eleurent commented 2 years ago

Hi, This error is very strange, it looks like it is caused by pygame (which we use to render the video frames), but I have no idea why it crashes. Do you have any other error message, or a stack trace that shows where it crashes?

Also, if you simply try to create the environment, step it and render it, does it work or does also cause a segmentation fault?

Exasor commented 2 years ago

Hi, I have the similiar problem too, and it happens when excuting 'import highway_env', and I run the code in Nvidia Jetson AGX Xavier with Ubuntu 18.04 wihch is arm64 and pygame==2.1.2.

Fatal Python error: (pygame parachute) Segmentation Fault

Current thread 0x0000007fb4bf8010 (most recent call first): File "/usr/lib/python3/dist-packages/apt/init.py", line 34 in File "", line 219 in _call_with_frames_removed File "", line 678 in exec_module File "", line 665 in _load_unlocked File "", line 955 in _find_and_load_unlocked File "", line 971 in _find_and_load File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 24 in File "", line 219 in _call_with_frames_removed File "", line 678 in exec_module File "", line 665 in _load_unlocked File "", line 955 in _find_and_load_unlocked File "", line 971 in _find_and_load File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 25 in File "", line 219 in _call_with_frames_removed File "", line 678 in exec_module File "", line 665 in _load_unlocked File "", line 955 in _find_and_load_unlocked File "", line 971 in _find_and_load File "/usr/lib/python3/dist-packages/apport/report.py", line 30 in File "", line 219 in _call_with_frames_removed File "", line 678 in exec_module File "", line 665 in _load_unlocked File "", line 955 in _find_and_load_unlocked File "", line 971 in _find_and_load File "/usr/lib/python3/dist-packages/apport/init.py", line 5 in File "", line 219 in _call_with_frames_removed File "", line 678 in exec_module File "", line 665 in _load_unlocked File "", line 955 in _find_and_load_unlocked File "", line 971 in _find_and_load File "", line 219 in _call_with_frames_removed File "", line 941 in _find_and_load_unlocked File "", line 971 in _find_and_load File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 72 in apport_excepthook Aborted (core dumped)

Exasor commented 2 years ago

Oh I switch the pygame version to 2.0.2, and it works well now.

eleurent commented 2 years ago

Nice! I should probably set this as the maximum required version for pygame then. Thanks for the feedback!

eleurent commented 2 years ago

Actually, it works fine for me in version 2.1.2, so there must have been something wrong with your specific config? Weird...

Exasor commented 2 years ago

I do think so, maybe there is somthing wrong when I set my python env under arm64.