Exception happened when I add dropout to the input layer.
The exception was mentioned in other threads as well related to another issues and most common suggested solution is to downgrade the Keras version. Is there a workaround for this exception?
def baseline_model() :
model = Sequential()
model.add(Dropout(0.35)) #THIS LINE CAUSES THE EXCEPTION
model.add(Dense(200, input_dim=1200, kernel_initializer='normal', activation='relu'))
model.add(Dropout(0.8))
rms = RMSprop(lr = 0.00050)
model.add(Dense(1, kernel_initializer='normal', activation='sigmoid'))
model.compile(loss='binary_crossentropy', optimizer=rms, metrics=['accuracy'])
return model
Model throws the following exception during weight file loading:
ValueError: You are trying to load a weight file containing 2 layers into a model with 0 layers.