Skip to content

Instantly share code, notes, and snippets.

@geohot
Created May 7, 2016 02:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save geohot/ce1e9a1c79548f457feddfbdc175fdfa to your computer and use it in GitHub Desktop.
Save geohot/ce1e9a1c79548f457feddfbdc175fdfa to your computer and use it in GitHub Desktop.
from keras.models import Sequential, Model
from keras.layers import Dense, Input, BatchNormalization as BN
input_img1 = Input(shape=(4,), name="input_img1")
vision_model = Sequential()
vision_model.add(Dense(4, input_shape=(4,)))
vision_model.add(BN(axis=1))
vision_model.add(Dense(4))
merged = vision_model(input_img1)
model = Model(input=[input_img1], output=[merged])
model.save_weights("/tmp/weights", True)
# load_weights fails
model.load_weights("/tmp/weights")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment