MATLAB might crash while attempting to train a reinforcement learning agent in parallel with ten or more workers. The crash is due to a communication race condition between the client and worker processes.
You can avoid this error by updating MATLAB to R2020a Update 3.
As a workaround, to bypass the communication race condition for PG, DQN, DDPG, TD3, and PPO agents, use synchronous parallel training and configure the workers to wait until the end of the episode before sending data to the host. To do so, configure your rlTrainingOptions object as shown in the following code:
>> trainOptions = rlTrainingOptions;
>> trainOptions.UseParallel = true;
>> trainOptions.ParallelizationOptions.Mode = "sync";
>> trainOptions.ParallelizationOptions.StepsUntilDataIsSent = -1;
Using StepsUntilDataIsSent = -1 is not supported for AC agents. To avoid a communication race condition for these agents, consider using a PPO agent with experience-based parallel training or a PG agent with gradient-based parallel training.