When I create a mujoco environment:
env = gym.make('HalfCheetahForwardBackward-v1')
An error is raised in the line 34 of "/learn2learn/gym/envs/meta_env,py": TypeError: init() missing 2 required positional arguments: 'model_path' and 'frame_skip'
Then, I found the reason why this error happens. In the meta_env.py file,
class MetaEnv(Env):
def __init__(self, task=None):
super(MetaEnv, self).__init__()
if task is None:
task = self.sample_tasks(1)[0]
self.set_task(task)
I think the intention of super(MetaEnv, self).__init__() is to call the initialization method of Env Class. However, actually this line calls the initialization method of MujocoEnv class which leads to the error. This is because of MujocoEnvis the next class of MetaEnv in the list of HalfCheetahForwardBackwardEnv.__mro__.
To fix this problem, super(MetaEnv, self).__init__() should be changed to Env.__init__(self)
When I create a mujoco environment:
env = gym.make('HalfCheetahForwardBackward-v1')
An error is raised in the line 34 of "/learn2learn/gym/envs/meta_env,py": TypeError: init() missing 2 required positional arguments: 'model_path' and 'frame_skip'Then, I found the reason why this error happens. In the meta_env.py file,
I think the intention of
super(MetaEnv, self).__init__()
is to call the initialization method ofEnv
Class. However, actually this line calls the initialization method ofMujocoEnv
class which leads to the error. This is because ofMujocoEnv
is the next class ofMetaEnv
in the list ofHalfCheetahForwardBackwardEnv.__mro__
.To fix this problem,
super(MetaEnv, self).__init__()
should be changed toEnv.__init__(self)