cherry icon indicating copy to clipboard operation
cherry copied to clipboard

Error using cherry and multiprocessing

Open nilslacroix opened this issue 4 years ago • 3 comments

System: Windows 10 Anaconda3 with Pycharm Latest cherry repo and learn2learn

I am using the learn2learn repo. The examples works fine with exception of maml_trpo.py which gives me the following exception:

C:\Users\master\anaconda3\envs\l2l\lib\site-packages\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 "<string>", line 1, in <module>
  File "C:\Users\master\anaconda3\envs\l2l\lib\multiprocessing\spawn.py", line 105, in spawn_main
    exitcode = _main(fd)
  File "C:\Users\master\anaconda3\envs\l2l\lib\multiprocessing\spawn.py", line 115, in _main
    self = reduction.pickle.load(from_parent)
  File "c:\users\master\desktop\l2l\cherry\cherry\envs\base.py", line 56, in __getattr__
    return getattr(self.env, attr)
  File "c:\users\master\desktop\l2l\cherry\cherry\envs\base.py", line 56, in __getattr__
    return getattr(self.env, attr)
  File "c:\users\master\desktop\l2l\cherry\cherry\envs\base.py", line 56, in __getattr__
    return getattr(self.env, attr)
  [Previous line repeated 494 more times]
  File "c:\users\master\desktop\l2l\cherry\cherry\envs\base.py", line 53, in __getattr__
    if attr in self.__dict__.keys():
RecursionError: maximum recursion depth exceeded while calling a Python object
Traceback (most recent call last):

The problem occurs when I use the ActionSpaceScaler.

 def make_env():
        env = gym.make(env_name)
        env = ch.envs.ActionSpaceScaler(env)
        return env

I looked at my recursion limit which is 1000. Maybe you can find out the problem. Thanks in advance, Nils.

nilslacroix avatar Aug 28 '20 08:08 nilslacroix

Hi @nilslacroix ,

Thanks for opening this issue. Could you share a small example reproducing the exception? (e.g. on Colab) The maml_trpo example runs fine on macOS and Ubuntu with Anaconda 3.

seba-1511 avatar Aug 28 '20 17:08 seba-1511

Actually I don't know yet how to reproduce the error. When I do not use the code line env = ch.envs.ActionSpaceScaler(env) the example runs perfectly fine. A collegue of mine uses the same enviroment as I do, but can't reproduce the error either, so it really is a strange behaviour.

nilslacroix avatar Aug 29 '20 20:08 nilslacroix

Hi @nilslacroix, @seba-1511 I met the same problem in https://github.com/learnables/learn2learn/issues/203. Do you find the reason that causes this problem?

Thanks in advance! Runsheng

yurunsheng1 avatar Dec 01 '20 03:12 yurunsheng1

Inactive; closing.

seba-1511 avatar Jun 25 '23 09:06 seba-1511