mirror of
https://github.com/clearml/clearml
synced 2025-06-26 18:16:07 +00:00
Add direct plotly figure reporting (see issue #136)
This commit is contained in:
@@ -176,10 +176,16 @@ class Reporter(InterfaceBase, AbstractContextManager, SetupUploadMixin, AsyncMan
|
||||
:param iter: Iteration number
|
||||
:type value: int
|
||||
"""
|
||||
# noinspection PyBroadException
|
||||
try:
|
||||
def default(o):
|
||||
if isinstance(o, np.int64):
|
||||
return int(o)
|
||||
# Special json encoder for numpy types
|
||||
def default(obj):
|
||||
if isinstance(obj, (np.integer, np.int64)):
|
||||
return int(obj)
|
||||
elif isinstance(obj, np.floating):
|
||||
return float(obj)
|
||||
elif isinstance(obj, np.ndarray):
|
||||
return obj.tolist()
|
||||
except Exception:
|
||||
default = None
|
||||
|
||||
|
||||
Reference in New Issue
Block a user