mirror of https://github.com/coqui-ai/TTS.git
Don't OOR values in train console log
This commit is contained in:
parent
c514351c0e
commit
3c7848e9b1
|
@ -47,9 +47,17 @@ class ConsoleLogger:
|
||||||
tcolors.BOLD, step, batch_steps, global_step, tcolors.ENDC
|
tcolors.BOLD, step, batch_steps, global_step, tcolors.ENDC
|
||||||
)
|
)
|
||||||
for key, value in loss_dict.items():
|
for key, value in loss_dict.items():
|
||||||
# print the avg value if given
|
|
||||||
if f"avg_{key}" in avg_loss_dict.keys():
|
if f"avg_{key}" in avg_loss_dict.keys():
|
||||||
|
# print the avg value if given
|
||||||
|
if isinstance(value, float) and round(value, 5) == 0:
|
||||||
|
# do not round the number if it is zero when rounded
|
||||||
|
log_text += "{}{}: {} ({})\n".format(indent, key, value, avg_loss_dict[f"avg_{key}"])
|
||||||
|
else:
|
||||||
|
# print the rounded value
|
||||||
log_text += "{}{}: {:.5f} ({:.5f})\n".format(indent, key, value, avg_loss_dict[f"avg_{key}"])
|
log_text += "{}{}: {:.5f} ({:.5f})\n".format(indent, key, value, avg_loss_dict[f"avg_{key}"])
|
||||||
|
else:
|
||||||
|
if isinstance(value, float) and round(value, 5) == 0:
|
||||||
|
log_text += "{}{}: {} \n".format(indent, key, value)
|
||||||
else:
|
else:
|
||||||
log_text += "{}{}: {:.5f} \n".format(indent, key, value)
|
log_text += "{}{}: {:.5f} \n".format(indent, key, value)
|
||||||
print(log_text, flush=True)
|
print(log_text, flush=True)
|
||||||
|
|
Loading…
Reference in New Issue