I am receiving an error on this line.
—> 49 outputs = prediction_layer(x)
50 model = tf.keras.Model(inputs, outputs)
The error message reads as follows: ‘tensorflow.python.framework.ops.EagerTensor’ object is not callable. After some searching, I am still unsure of the meaning of this error message or how to fix it.
I think that the error could be with how I created the prediction layer. Here is my code below:
# set training to False to avoid keeping track of statistics in the batch norm layer
x = base_model(image_batch, training=False)
# Add the new Binary classification layers
# use global avg pooling to summarize the info in each channel
x = tfl.GlobalAveragePooling2D()(x)
#include dropout with probability of 0.2 to avoid overfitting
x = tfl.Dropout(0.2)(x)
# create a prediction layer with one neuron (as a classifier only needs one)
prediction_layer = tfl.Dense(units=1, activation='linear')(x)
Thanks for any advice!