#1386: fix bug with agent zip file not being saved after run
This commit is contained in:
@@ -89,6 +89,7 @@ class SB3Agent(AgentSessionABC):
|
||||
for i in range(episodes):
|
||||
self._agent.learn(total_timesteps=time_steps)
|
||||
self._save_checkpoint()
|
||||
self.save(self.learning_path / f"sb3_{self._training_config.agent_identifier}_{self.timestamp_str}.zip")
|
||||
self._env.reset()
|
||||
self._env.close()
|
||||
super().learn()
|
||||
@@ -123,6 +124,7 @@ class SB3Agent(AgentSessionABC):
|
||||
if isinstance(action, np.ndarray):
|
||||
action = np.int64(action)
|
||||
obs, rewards, done, info = self._env.step(action)
|
||||
self.save(self.evaluation_path / f"sb3_{self._training_config.agent_identifier}_{self.timestamp_str}.zip")
|
||||
self._env.reset()
|
||||
self._env.close()
|
||||
super().evaluate()
|
||||
@@ -132,10 +134,6 @@ class SB3Agent(AgentSessionABC):
|
||||
"""Load an agent from file."""
|
||||
raise NotImplementedError
|
||||
|
||||
def save(self):
|
||||
"""Save the agent."""
|
||||
raise NotImplementedError
|
||||
|
||||
def export(self):
|
||||
"""Export the agent to transportable file format."""
|
||||
raise NotImplementedError
|
||||
|
||||
Reference in New Issue
Block a user