From 25878c7286f3475ea4de58bef12dd18d67fb8a4f Mon Sep 17 00:00:00 2001 From: "Egli Adrian (IT-SCI-API-PFI)" <adrian.egli@sbb.ch> Date: Tue, 19 Jan 2021 17:45:03 +0100 Subject: [PATCH] load message fix --- reinforcement_learning/ppo_agent.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/reinforcement_learning/ppo_agent.py b/reinforcement_learning/ppo_agent.py index 9a43aff..8a734c7 100644 --- a/reinforcement_learning/ppo_agent.py +++ b/reinforcement_learning/ppo_agent.py @@ -85,7 +85,7 @@ class ActorCriticModel(nn.Module): return obj def load(self, filename): - print("load policy from file", filename) + print("load model from file", filename) self.actor = self._load(self.actor, filename + ".actor") self.critic = self._load(self.critic, filename + ".value") @@ -284,6 +284,8 @@ class PPOPolicy(LearningPolicy): obj.load_state_dict(torch.load(filename, map_location=self.device)) except: print(" >> failed!") + else: + print(" >> file not found!") return obj def load(self, filename): -- GitLab