Commit c500fa13 authored by Yuxin Wu's avatar Yuxin Wu

monitor handle numpy.float for scalar type

parent 47814f1f
...@@ -140,6 +140,8 @@ class Monitors(Callback): ...@@ -140,6 +140,8 @@ class Monitors(Callback):
""" """
Put a scalar. Put a scalar.
""" """
if isinstance(val, (np.float32, np.float64)):
val = float(val)
self._dispatch(lambda m: m.process_scalar(name, val)) self._dispatch(lambda m: m.process_scalar(name, val))
s = create_scalar_summary(name, val) s = create_scalar_summary(name, val)
self._dispatch(lambda m: m.process_summary(s)) self._dispatch(lambda m: m.process_summary(s))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment