Skip to content

Instantly share code, notes, and snippets.

@pavlin-policar
Last active February 23, 2017 17:26
Show Gist options
  • Save pavlin-policar/a42628297db78b392a28773c276b6fb7 to your computer and use it in GitHub Desktop.
Save pavlin-policar/a42628297db78b392a28773c276b6fb7 to your computer and use it in GitHub Desktop.
Can't load_model with error “Optimizer weight shape (...) not compatible with provided weight shape (...)”
# Solution found here: https://github.com/fchollet/keras/issues/4044
import h5py
f = h5py.File('model_file.h5', 'r+')
del f['optimizer_weights']
f.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment