|
4 | 4 |
|
5 | 5 | import os |
6 | 6 | import sys |
7 | | -import json |
8 | 7 | import logging |
9 | 8 | from typing import Dict, Optional, Set |
10 | 9 | from collections import defaultdict |
|
18 | 17 | UnityCommunicationException, |
19 | 18 | ) |
20 | 19 | from mlagents.trainers.sampler_class import SamplerManager |
21 | | -from mlagents_envs.timers import hierarchical_timer, get_timer_tree, timed |
| 20 | +from mlagents_envs.timers import hierarchical_timer, timed |
22 | 21 | from mlagents.trainers.trainer import Trainer |
23 | 22 | from mlagents.trainers.meta_curriculum import MetaCurriculum |
24 | 23 | from mlagents.trainers.trainer_util import TrainerFactory |
@@ -106,16 +105,6 @@ def _save_model_when_interrupted(self): |
106 | 105 | ) |
107 | 106 | self._save_model() |
108 | 107 |
|
109 | | - def _write_timing_tree(self) -> None: |
110 | | - timing_path = f"{self.summaries_dir}/{self.run_id}_timers.json" |
111 | | - try: |
112 | | - with open(timing_path, "w") as f: |
113 | | - json.dump(get_timer_tree(), f, indent=4) |
114 | | - except FileNotFoundError: |
115 | | - self.logger.warning( |
116 | | - f"Unable to save to {timing_path}. Make sure the directory exists" |
117 | | - ) |
118 | | - |
119 | 108 | def _export_graph(self): |
120 | 109 | """ |
121 | 110 | Exports latest saved models to .nn format for Unity embedding. |
@@ -231,7 +220,6 @@ def start_learning(self, env_manager: EnvManager) -> None: |
231 | 220 | pass |
232 | 221 | if self.train_model: |
233 | 222 | self._export_graph() |
234 | | - self._write_timing_tree() |
235 | 223 |
|
236 | 224 | def end_trainer_episodes( |
237 | 225 | self, env: EnvManager, lessons_incremented: Dict[str, bool] |
|
0 commit comments