Open lvjinqiao opened 3 years ago
我碰到了相同的问题,这两句逻辑不对,运行报错,注释掉以后又会在reset函数里出错,
I learned to use your code on windows, but encountered the problem of oserror and eoferror. I checked it env.py I don't think the following paragraph is meaningful. Would you please explain the meaning of this code? Because my mother tongue is not English, can you understand what I mean??
# for index in range(num_envs): # # process = mp.Process(target=self.run, args=(index,)) # process.start() # # # self.env_conns[index].close() # # def run(self, index): # # # self.agent_conns[index].close() # while True: # # request, action = self.env_conns[index].recv() # print(request,action) # if request == "step": # self.env_conns[index].send(self.envs[index].step(action.item())) # elif request == "reset": # self.env_conns[index].send(self.envs[index].reset()) # # else: # raise NotImplementedError
This problem does not occur when running Ubuntu, but it does on win10
I figure out what the problem is in win10 first, comment this two lines in env.py,you can‘t use pipe like this in window
self.env_conns[index].close()
....
self.agent_conns[index].close()
next, in env.py the class MultipleEnvironments create all envs in main process and try to access each single env in subprocess but the _LIB in nes_py can't share during processes because some share memory police in window,i guess. so, we should create each single env in each subprocess, in function run()
I learned to use your code on windows, but encountered the problem of oserror and eoferror. I checked it env.py I don't think the following paragraph is meaningful. Would you please explain the meaning of this code? Because my mother tongue is not English, can you understand what I mean??