Can't change activations in existing Keras model
问题 I have a normal VGG16 model with relu activations, i.e. def VGG_16(weights_path=None): model = Sequential() model.add(ZeroPadding2D((1, 1),input_shape=(3, 224, 224))) model.add(Convolution2D(64, 3, 3, activation='relu')) model.add(ZeroPadding2D((1, 1))) model.add(Convolution2D(64, 3, 3, activation='relu')) model.add(MaxPooling2D((2, 2), strides=(2, 2))) [...] model.add(Flatten()) model.add(Dense(4096, activation='relu')) model.add(Dropout(0.5)) model.add(Dense(4096, activation='relu')) model