Last active
September 29, 2016 11:46
-
-
Save leondz/e546dd2ce4aa8ab64c805d1fb996ec21 to your computer and use it in GitHub Desktop.
Demonstrate failure to load with custom metrics defined
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from keras.models import load_model, Sequential | |
| from keras.layers import Dense | |
| def x(y_true, y_pred): | |
| return 0.0 * y_pred | |
| model = Sequential([ | |
| Dense(1, input_dim=1), | |
| ]) | |
| model.compile(optimizer='rmsprop', | |
| loss='categorical_crossentropy', | |
| metrics=[x]) | |
| model.save('somefile') | |
| break_here = load_model('somefile') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment