-
Notifications
You must be signed in to change notification settings - Fork 162
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
KeyError: 'batchnormalizationv1' #81
Comments
What's your Keras version?
…On Tue, 4 Jun 2019 at 11:32, Gasp34 ***@***.***> wrote:
Hey :) I'm trying to use kc.convert_model_from_saved_files but I have this
keyerror : 'batchnormalizationv1'
The model is not complicated and it works without the batchnormalization
layers.
def create_model():
from tensorflow.keras.layers import Conv1D, Dense, MaxPooling1D, Flatten, Dropout, BatchNormalization, Activation
from tensorflow.keras.models import Sequential
from tensorflow.keras.optimizers import SGD
model = Sequential()
model.add(Conv1D(filters=300, kernel_size=19, padding='same', # activation='relu', # , activation='relu'
input_shape=(251, 4)))
model.add(BatchNormalization())
model.add(Activation('relu'))
model.add(MaxPooling1D(pool_size=3, strides=3, padding='same'))
model.add(Conv1D(filters=200, kernel_size=11, padding='same')) # , activation='relu'
model.add(BatchNormalization())
model.add(Activation('relu'))
model.add(MaxPooling1D(pool_size=4, strides=4, padding='same'))
model.add(Conv1D(filters=200, kernel_size=7, padding='same')) # , activation='relu'
model.add(BatchNormalization())
model.add(Activation('relu'))
model.add(MaxPooling1D(pool_size=4, strides=4, padding='same'))
model.add(Flatten())
model.add(Dense(1000, activation='relu')) # kernel_regularizer=keras.regularizers.l2(0.001),
model.add(Dropout(0.03)) # change dropout rate to 0.03
model.add(Dense(1000, activation='relu'))
model.add(Dropout(0.03)) # change dropout rate to 0.03
## Change this number to adapt to the number of classes
model.add(Dense(81)) # softmax vs. sigmoid? , activation='sigmoid'
sgd = SGD(lr=0.002, decay=0, momentum=0.98, nesterov=True) # decay=1e-6,
model.compile(loss=pearson_loss, optimizer=sgd, metrics=['mse'])
return model
model = create_model()
model.save(checkpoint_path + model_name+'.h5')
keras_model_weights = folder + 'results/keras/' + model_name + '.h5'
deeplift_model = kc.convert_model_from_saved_files(h5_file=keras_model_weights)
Can someone help me with this please ? :)
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#81?email_source=notifications&email_token=AARSFBVYYUSFK74QAAD3IXDPY2YMFA5CNFSM4HS7Z5V2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4GXTFZIA>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AARSFBVVIDWU7WV5ZMCULJDPY2YMFANCNFSM4HS7Z5VQ>
.
|
It is 2.2.4 |
Fixed by removing all the "tenserflow." in the import : |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey :) I'm trying to use kc.convert_model_from_saved_files but I have this keyerror :
The model is not complicated and it works without the batchnormalization layers.
Can someone help me with this please ? :)
The text was updated successfully, but these errors were encountered: