tensorflow - 'KerasLayer' object has no attribute 'layers ...
stackoverflow.com › questions › 60701178Mar 16, 2020 · I met the same problem as you yesterday,but luckily for me, i have found two ways to solve the problem. 1.base_model = tf.keras.applications.MobileNetV2(input_shape=IMG_SHAPE, include_top=False, weights='imagenet' ) base_model.trainable = False global_average_layer = tf.keras.layers.GlobalAveragePooling2D() prediction_layer = tf.keras.layers.Dense(59) model = tf.keras.Sequential([ base_model ...