DLR-RM / stable-baselines3

PyTorch version of Stable Baselines, reliable implementations of reinforcement learning algorithms.
https://stable-baselines3.readthedocs.io
MIT License
8.35k stars 1.6k forks source link

[Question] multi processus observation collection #1949

Closed kenzlegouge closed 1 week ago

kenzlegouge commented 2 weeks ago

❓ Question

I built an env that relies on an external DLL. Due to the constraints of this Dll, it cannot be loaded twice in the same process. This makes make_vec_env impossible.

Is it possible launch multiple env in separate processes, and collect the different observations and feed them to the learner (PPO in my case)?

Checklist

araffin commented 1 week ago

Is it possible launch multiple env in separate processes, and collect the different observations and feed them to the learner (PPO in my case)?

Hello, have you looked into SubprocVecEnv in the doc? (it can be passed as parameter to make_vec_env)