using pretrained convnet with this setuponly the weights from the two dense layers that you added will be trained that' total of four weight tensorstwo per layer (the main weight matrix and the bias vectornote that in order for these changes to take effectyou must first compile the model if you ever modify weight trainability after compilationyou should then recompile the modelor these changes will be ignored now you can start training your modelwith the same data-augmentation configuration that you used in the previous example listing training he model end end with frozen convolut ional base from keras preprocessing image import imagedatagenerator from keras import optimizers train_datagen imagedatageneratorrescale= / rotation_range= width_shift_range= height_shift_range= shear_range= zoom_range= horizontal_flip=truefill_mode='nearest'note that the validation data shouldn' be augmentedtest_datagen imagedatagenerator(rescale= / train_generator train_datagen flow_from_directorytrain_dirtarget target_size=( )resizes all images to directory batch_size= class_mode='binary'validation_generator test_datagen flow_from_directoryvalidation_dirtarget_size=( )batch_size= class_mode='binary'because you use binary_crossentropy lossyou need binary labels model compile(loss='binary_crossentropy'optimizer=optimizers rmsprop(lr= - )metrics=['acc']history model fit_generatortrain_generatorsteps_per_epoch= epochs= validation_data=validation_generatorvalidation_steps= let' plot the results again (see figures and as you can seeyou reach validation accuracy of about this is much better than you achieved with the small convnet trained from scratch licensed to