mirror of
https://github.com/clearml/clearml
synced 2025-02-07 13:23:40 +00:00
Fix NaN, Inf and -Inf values in reported table (not supported by JSON)
This commit is contained in:
parent
d48fa33744
commit
2848e9190e
@ -1,4 +1,5 @@
|
||||
import logging
|
||||
import math
|
||||
import warnings
|
||||
from typing import Any, Sequence, Union, List, Optional, Tuple
|
||||
|
||||
@ -299,10 +300,19 @@ class Logger(object):
|
||||
elif csv:
|
||||
table = pd.read_csv(csv)
|
||||
|
||||
def replace(dst, *srcs):
|
||||
for src in srcs:
|
||||
reporter_table.replace(src, dst, inplace=True)
|
||||
|
||||
reporter_table = table.fillna(str(np.nan))
|
||||
replace("NaN", np.nan, math.nan)
|
||||
replace("Inf", np.inf, math.inf)
|
||||
replace("-Inf", -np.inf, np.NINF, -math.inf)
|
||||
|
||||
return self._task.reporter.report_table(
|
||||
title=title,
|
||||
series=series,
|
||||
table=table,
|
||||
table=reporter_table,
|
||||
iteration=iteration
|
||||
)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user