yandexdataschool / Practical_RL

A course in reinforcement learning in the wild
The Unlicense
5.93k stars 1.7k forks source link

Support MacOS in A2C homework multiprocessing #520

Closed q0o0p closed 1 year ago

q0o0p commented 1 year ago

Multiprocessing in Python works differently on Windows and on Linux. On Windows it copies the objects and in Linux it doesn't. As a result, some code that works fine on Linux may not work on Windows. E.g. in our A2C homework we use lambda functions. Lambda functions are not serializable, so object copying during multiprocessing would fail on Windows. As for MacOS, it can behave like Linux or like Windows depending on settings.

In this commit I added an instruction that will make the multiprocessing behave like Linux