[Python] Python function deepcopy does not copy gym environment LunarLanderContinuous-v2...

Discussão em 'Python' iniciado por Stack, Março 11, 2025.

  1. Stack

    Stack Membro Participativo

    As the code and its output shows the deepcopy of this environment does not copy aspects of the environment such as the 'action_space' and the attribute 'continuous'.

    How can this be resolved?

    import gym, copy
    env = gym.make('LunarLanderContinuous-v2')
    print(env.action_space)
    print(env.continuous)
    env1 = copy.deepcopy(env)
    # env1.continuous = True
    print(env1.action_space)
    print(env1.continuous)


    action_space Box(-1.0, 1.0, (2,), float32)


    continuous True


    action_space Discrete(4)


    continuous False
    ​

    Continue reading...

Compartilhe esta Página