Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed RemoteMonitor: Json to handle np.float32 and np.int32 types #9261

Merged
merged 6 commits into from
Feb 2, 2018
5 changes: 4 additions & 1 deletion keras/callbacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,10 @@ def on_epoch_end(self, epoch, logs=None):
send = {}
send['epoch'] = epoch
for k, v in logs.items():
send[k] = v
if isinstance(v, (np.ndarray, np.generic)):
send[k] = v.item()
else:
send[k] = v
try:
requests.post(self.root + self.path,
{self.field: json.dumps(send)},
Expand Down