From 97c43284a67b61125723e65122f7254944cccbc3 Mon Sep 17 00:00:00 2001 From: Eric Liang Date: Tue, 23 Jul 2019 21:18:58 -0700 Subject: [PATCH] [rllib] Fix trainer state restore (#5257) --- python/ray/rllib/agents/trainer_template.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/ray/rllib/agents/trainer_template.py b/python/ray/rllib/agents/trainer_template.py index ee0b4181c..70bdf254d 100644 --- a/python/ray/rllib/agents/trainer_template.py +++ b/python/ray/rllib/agents/trainer_template.py @@ -151,12 +151,12 @@ def build_trainer(name, def __getstate__(self): state = Trainer.__getstate__(self) - state.update(self.state) + state["trainer_state"] = self.state.copy() return state def __setstate__(self, state): Trainer.__setstate__(self, state) - self.state = state + self.state = state["trainer_state"].copy() @staticmethod def with_updates(**overrides):