metadriverse / metadrive

MetaDrive: Open-source driving simulator
https://metadriverse.github.io/metadrive/
Apache License 2.0
671 stars 100 forks source link

Headless running (without 3D rendering) #705

Open EhsanSabouni opened 2 months ago

EhsanSabouni commented 2 months ago

Hi I hope you are doing well.

I want to run the envs without 3D rendering/visualization for two main reasons. 1) Running headless will make it much faster in training 2) I am also trying to run the code by ssh to my server-based machine but unfortunately I cannot run with visualization. I would be thankful if someone can tell me how I can run the metadrive simulation without visualization and if that is going to solve my problem with running through ssh.

Best regards

QuanyiLi commented 2 months ago

Hi,

Are you only interested in simulating with physics and without any camera output? If so, you can turn off rendering by specifying use_render=False in the environment config. If you need to collect camera data for your model training, please see: https://metadrive-simulator.readthedocs.io/en/latest/install.html#install-metadrive-with-headless-rendering You can even let your headless machine output images for each frame, and combine them to a video with ffmpeg, so you can have visualization results as well.

Best, Quanyi