while executing this i am getting error -
code:
av1 =GlobalAveragePooling2D()(model.output)
fc1 = Dense(256, activation=‘relu’)(av1)
d1 = Dropout(0.5)(fc1)
fc2 = Dense(4,activation=‘softmax’)(d1)
model_new = Model(inputs=model.input,outputs=fc2)
model_new.summary()
###error:
TypeError: Cannot convert a symbolic Keras input/output to a numpy array. This error may indicate that you’re trying to pass a symbolic value to a NumPy call, which is not supported. Or, you may be trying to pass Keras symbolic inputs/outputs to a TF API that does not register dispatching, preventing Keras from automatically converting the API call to a lambda layer in the Functional Model.