Automatically indent tune logger params (#3399)

This commit is contained in:
Kristian Hartikainen
2018-11-29 00:15:50 -08:00
committed by Eric Liang
parent c46ea2ff4b
commit 7e319dbf0c
+6 -1
View File
@@ -97,7 +97,12 @@ class _JsonLogger(Logger):
def _init(self):
config_out = os.path.join(self.logdir, "params.json")
with open(config_out, "w") as f:
json.dump(self.config, f, sort_keys=True, cls=_SafeFallbackEncoder)
json.dump(
self.config,
f,
indent=2,
sort_keys=True,
cls=_SafeFallbackEncoder)
local_file = os.path.join(self.logdir, "result.json")
self.local_out = open(local_file, "w")