RITCHIEHuang / DeepRL_Algorithms

DeepRL algorithms implementation easy for understanding and reading with Pytorch and Tensorflow 2(DQN, REINFORCE, VPG, A2C, TRPO, PPO, DDPG, TD3, SAC)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Issue with num_process while running trpo_mujoco script

balasurajp opened this issue · comments

Terminal freezes without any error. There is some bug related to multiprocessing in the memory collector class.

@surajpedasingu Thanks for pointing out the bug, the memory collector was designed to compatible for multiprocessing to accelerate the sampling step, you can set num_process=1 just to verify the algorithm itself, I will try to fix the bug as soon as possible.

@surajpedasingu The bug caused by multiprocessing package is incompatible with torch, now it's fixed now, and you can check it.

@RITCHIEHuang Yes it was working with num_process=1. I dont understand how are you trying to acclerate sampling when the underlying policy & env are single objects and the same objects are being passed to multiple processes. In this case, sampling wont be accelerated as processes will be executed in sequential order because underlying objects will be locked when one process is using them. Correct me if I'm wrong?

@surajpedasingu Yeah, here the collector use multi processes to collect samples without updating the policy parameters, the policy & env itselves is not changed, we still can use less time to sample same samples.