Closed yeukfu closed 4 years ago
In the samplers, we use copy.deepcopy() to copy env_update. This works fine when the environment has default max_episode_length. However, when copying an environment with a customized max_episode_length, the spec is copied wrongly. For example:
copy.deepcopy()
env_update
max_episode_length
import copy from garage.envs import GymEnv def copy_env(): env = GymEnv('InvertedDoublePendulum-v2', max_episode_length=100) env_cp = copy.deepcopy(env) print(env.spec.max_episode_length) print(env_cp.spec.max_episode_length) copy_env()
This code will output
100 1000
In the samplers, we use
copy.deepcopy()
to copyenv_update
. This works fine when the environment has defaultmax_episode_length
. However, when copying an environment with a customizedmax_episode_length
, the spec is copied wrongly. For example:This code will output