mirror of
https://github.com/clearml/clearml
synced 2025-04-27 17:51:45 +00:00
Fix Tensorflow add_image with description='text'
This commit is contained in:
parent
aff39ae061
commit
569ab6610d
@ -1254,20 +1254,22 @@ class PatchTensorFlowEager(object):
|
|||||||
# noinspection PyBroadException
|
# noinspection PyBroadException
|
||||||
try:
|
try:
|
||||||
plugin_type = summary_metadata.decode()
|
plugin_type = summary_metadata.decode()
|
||||||
if plugin_type.endswith('scalars'):
|
# remove any none alpha numeric value
|
||||||
|
plugin_type = plugin_type[next(i for i, c in enumerate(plugin_type) if c >= 'A'):]
|
||||||
|
if plugin_type.startswith('scalars'):
|
||||||
event_writer._add_scalar(tag=str(tag),
|
event_writer._add_scalar(tag=str(tag),
|
||||||
step=int(step.numpy()) if not isinstance(step, int) else step,
|
step=int(step.numpy()) if not isinstance(step, int) else step,
|
||||||
scalar_data=tensor.numpy())
|
scalar_data=tensor.numpy())
|
||||||
elif plugin_type.endswith('images'):
|
elif plugin_type.startswith('images'):
|
||||||
img_data_np = tensor.numpy()
|
img_data_np = tensor.numpy()
|
||||||
PatchTensorFlowEager._add_image_event_helper(event_writer, img_data_np=img_data_np,
|
PatchTensorFlowEager._add_image_event_helper(event_writer, img_data_np=img_data_np,
|
||||||
tag=tag, step=step, **kwargs)
|
tag=tag, step=step, **kwargs)
|
||||||
elif plugin_type.endswith('histograms'):
|
elif plugin_type.startswith('histograms'):
|
||||||
event_writer._add_histogram(
|
event_writer._add_histogram(
|
||||||
tag=str(tag), step=int(step.numpy()) if not isinstance(step, int) else step,
|
tag=str(tag), step=int(step.numpy()) if not isinstance(step, int) else step,
|
||||||
hist_data=tensor.numpy()
|
hist_data=tensor.numpy()
|
||||||
)
|
)
|
||||||
elif plugin_type.endswith('text'):
|
elif plugin_type.startswith('text'):
|
||||||
event_writer._add_text(
|
event_writer._add_text(
|
||||||
tag=str(tag), step=int(step.numpy()) if not isinstance(step, int) else step,
|
tag=str(tag), step=int(step.numpy()) if not isinstance(step, int) else step,
|
||||||
tensor_bytes=tensor.numpy()
|
tensor_bytes=tensor.numpy()
|
||||||
|
Loading…
Reference in New Issue
Block a user