tristandeleu/pytorch-maml-rl

Can this code run in win10 ?

Opened this issue · 3 comments

I find you have update your code recently. Your work is very amazing to me, I really thank you very much. But I also find that your code can't run in win10 but can run in linux.

I have the same question. When I run the train.py, I got the following error message:
(YYY) XXX\pytorch-maml-rl>python train.py --config configs/maml/halfcheetah-vel.yaml --output-folder maml-halfcheetah-vel --seed 1 --num-workers 8

C:\XXX\envs\xxx\lib\site-packages\gym-0.17.1-py3.7.egg\gym\logger.py:30: UserWarning: WARN: Box bound precision lowered by casting to float32
warnings.warn(colorize('%s: %s'%('WARN', msg % args), 'yellow'))
Traceback (most recent call last):
File "train.py", line 118, in
main(args)
File "train.py", line 54, in main
num_workers=args.num_workers)
File "XXX\pytorch-maml-rl\maml_rl\samplers\multi_task_sampler.py", line 107, in init
worker.start()
File "C:\XXX\envs\xxx\lib\multiprocessing\process.py", line 112, in start
self._popen = self._Popen(self)
File "C:\XXX\envs\xxx\lib\multiprocessing\context.py", line 223, in _Popen
return _default_context.get_context().Process._Popen(process_obj)
File "C:\XXX\envs\xxx\lib\multiprocessing\context.py", line 322, in _Popen
return Popen(process_obj)
File "C:\XXX\envs\xxx\lib\multiprocessing\popen_spawn_win32.py", line 89, in init
reduction.dump(process_obj, to_child)
File "C:\XXX\envs\xxx\lib\multiprocessing\reduction.py", line 60, in dump
ForkingPickler(file, protocol).dump(obj)
AttributeError: Can't pickle local object 'make_env.._make_env'

(YYY) XXX\pytorch-maml-rl>Traceback (most recent call last):
File "", line 1, in
File "C:\XXX\envs\xxx\lib\multiprocessing\spawn.py", line 105, in spawn_main
exitcode = _main(fd)
File "C:\XXX\envs\xxx\lib\multiprocessing\spawn.py", line 115, in _main
self = reduction.pickle.load(from_parent)
EOFError: Ran out of input

(YYY) XXX\pytorch-maml-rl>python train.py --config configs/maml/halfcheetah-vel.yaml --output-folder maml-halfcheetah-vel --seed 1 --num-workers 1
C:\XXX\envs\xxx\lib\site-packages\gym-0.17.1-py3.7.egg\gym\logger.py:30: UserWarning: WARN: Box bound precision lowered by casting to float32
warnings.warn(colorize('%s: %s'%('WARN', msg % args), 'yellow'))
Traceback (most recent call last):
File "train.py", line 118, in
main(args)
File "train.py", line 54, in main
num_workers=args.num_workers)
File "XXX\pytorch-maml-rl\maml_rl\samplers\multi_task_sampler.py", line 107, in init
worker.start()
File "C:\XXX\envs\xxx\lib\multiprocessing\process.py", line 112, in start
self._popen = self._Popen(self)
File "C:\XXX\envs\xxx\lib\multiprocessing\context.py", line 223, in _Popen
return _default_context.get_context().Process._Popen(process_obj)
File "C:\XXX\envs\xxx\lib\multiprocessing\context.py", line 322, in _Popen
return Popen(process_obj)
File "C:\XXX\envs\xxx\lib\multiprocessing\popen_spawn_win32.py", line 89, in init
reduction.dump(process_obj, to_child)
File "C:\XXX\envs\xxx\lib\multiprocessing\reduction.py", line 60, in dump
ForkingPickler(file, protocol).dump(obj)
AttributeError: Can't pickle local object 'make_env.._make_env'
(YYY) XXX\pytorch-maml-rl>Traceback (most recent call last):
File "", line 1, in
File "C:\XXX\envs\xxx\lib\multiprocessing\spawn.py", line 105, in spawn_main
exitcode = _main(fd)
File "C:\XXX\envs\xxx\lib\multiprocessing\spawn.py", line 115, in _main
self = reduction.pickle.load(from_parent)
EOFError: Ran out of input

Hi, sorry for the late reply. I haven't tested the code on Windows 10, I've only tested it on Ubuntu and MacOS. It looks like this is an issue with the default context used for multiprocessing in Windows 10 being different from Unix, but I don't know enough about that to be 100% sure. I have unfortunately no way of testing it myself, so any help is welcome for this issue.

I have the same question, did this question solved?