I am trying to use Efficientnet for some object detection and are loading its checkpoint before providing some images. If I set
tf.keras.backend.set_learning_phase(True) before doing predictions it results in bad predictions. With that I mean it only has 2 detections with a score above 0.5 threshold (there are about 10 people in the images). If I however have
tf.keras.backend.set_learning_phase(False) and doing predictions it has far more detections (about 8) and the threshold is ranging from 0.7 – 0.94.
Why is this happening based on the
Thanks for any help!
That one is a deprecated function in new versions actually. Some layers(BatchNorm – Dropout) behave differently in training and testing.
tf.keras.backend.set_learning_phase(True) you actually leave them in training mode so they are active. You want them disabled when making a prediction.
For more check the source.
Answered By – Frightera