lcswillems / torch-ac

Recurrent and multi-process PyTorch implementation of deep reinforcement Actor-Critic algorithms A2C and PPO
MIT License
190 stars 65 forks source link

adds explicit killing of workers #4

Closed kkarrancsu closed 4 years ago

kkarrancsu commented 4 years ago

We ran into some problems when using the ParallelEnv class for some environments, where it seems that workers were not being killed properly. This update simply adds explicit destruction of workers.

lcswillems commented 4 years ago

Thank you @kkarrancsu for this PR!

To be sure of what your code is doing: workers will be killed when the ParallelEnv class instance is destroyed by Python at the end of the program?

kkarrancsu commented 4 years ago

Yup, exactly!

lcswillems commented 3 years ago

I reverted your PR because of this issue: https://github.com/lcswillems/rl-starter-files/issues/42

I prefer the version there was before because I never got a problem with it so I am more confident with it.