Closed mitsu3291 closed 2 years ago
hi, it seams i have the same error: File "mjbatchrenderer.pyx", line 2, in mujoco_py.cymj TypeError: no default reduce due to non-trivial cinit
can you tell me how did you solved it?
I stopped using Pool module.
I wrote code using Process module like this: then it works.
xml_path = "..."
process_num = ""
def test(self, id, seed):
model = mujoco_py.load_model_from_path(xml_path)
sim = mujoco_py.MjSim(model)
for _ in range(100):
sim.step()
def rollout(self):
processes = []
seeds = np.random.randint(0, 2**32-1, process_num)
for id in range(process_num):
processes.append(Process(target=test, args=[id, seeds[id]]))
for id in range(process_num):
processes[id].start()
for id in range(process_num):
processes[id].join()
and also you can use Value module and decide how many rollouts executed if you want.
I tried to do parallel processing using mujoco environment, but I could not do that. How can I do parallel processing?
Environment:
I wrote the code like this:
And I got the error: