Skip to content

Commit

Permalink
fix(nyz): fix gym env deepcopy spec bug
Browse files Browse the repository at this point in the history
  • Loading branch information
PaParaZz1 committed Feb 15, 2023
1 parent 0472a3a commit 8b1f05b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ding/envs/env/ding_env_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit 8b1f05b

Please sign in to comment.