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

Conversation

Vijayabhaskar96
Copy link
Contributor

@Vijayabhaskar96 Vijayabhaskar96 commented Jan 31, 2018

Previously lr log had dtype numpy.float32 which throws JSON serializable error if used along with Remote monitor callback.Fixed it by casting it to float.

Previously lr log had dtype numpy.float32 which throws JSON serializable error if used along with Remote monitor callback.
@fchollet
Copy link
Collaborator

Fix this in the remote monitor callback directly. Changing the type of log values for all callbacks would break backwards compatibility (as seen in test failures for this PR).

@Vijayabhaskar96
Copy link
Contributor Author

Noob at contribution here,Will fix it properly next time ☺️

@Vijayabhaskar96 Vijayabhaskar96 changed the title casted ReduceLRonPlateau lr log to float fixed RemoteMonitor: Json to handle np.float32 and np.int32 types Feb 1, 2018
if isinstance(v, (np.float16, np.float32)):
send[k] = np.float64(v)
elif isinstance(v, (np.int16, np.int32)):
send[k] = np.int64(v)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if isinstance(v, np.ndarray):
    send[k] = v.item()
else:
    send[k] = v

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed as per suggestion,Travis build failed due to some tensorflow installation error,I guess re-running the test will pass the PR

Copy link
Collaborator

@fchollet fchollet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@fchollet fchollet merged commit 649fd0d into keras-team:master Feb 2, 2018
ahundt added a commit to ahundt/keras that referenced this pull request Feb 16, 2018
* 'master' of github.com:fchollet/keras: (57 commits)
  Minor README edit
  Speed up Travis tests (keras-team#9386)
  fix typo (keras-team#9391)
  Fix style issue in docstring
  Prepare 2.1.4 release.
  Fix activity regularizer + model composition test
  Corrected copyright years (keras-team#9375)
  Change default interpolation from nearest to bilinear. (keras-team#8849)
  a capsule cnn on cifar-10 (keras-team#9193)
  Enable us to use sklearn to do cv for functional api (keras-team#9320)
  Add support for stateful metrics. (keras-team#9253)
  The type of list keys was float (keras-team#9324)
  Fix mnist sklearn wrapper example (keras-team#9317)
  keras-team#9287 Fix most of the file-handle resource leaks. (keras-team#9309)
  Pass current learning rate to schedule() in LearningRateScheduler (keras-team#8865)
  Simplify with from six.moves import input (keras-team#9216)
  fixed RemoteMonitor: Json to handle np.float32 and np.int32 types (keras-team#9261)
  Update tweet length from 140 to 280 in docs
  Add `depthconv_conv2d` tests (keras-team#9225)
  Remove `force` option in progbar
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants