diff --git a/ding/envs/env/ding_env_wrapper.py b/ding/envs/env/ding_env_wrapper.py index 08173b9075..6cd4392708 100644 --- a/ding/envs/env/ding_env_wrapper.py +++ b/ding/envs/env/ding_env_wrapper.py @@ -199,8 +199,10 @@ def reward_space(self) -> gym.spaces.Space: def clone(self) -> BaseEnv: try: + spec = copy.deepcopy(self._raw_env.spec) raw_env = CloudPickleWrapper(self._raw_env) raw_env = copy.deepcopy(raw_env).data + raw_env.__setattr__('spec', spec) except Exception: raw_env = self._raw_env return DingEnvWrapper(raw_env, self._cfg, self._seed_api)