Describe the bug
Efficientdet is training, loss is going down as expected, but predictions are messed up.
Just some simple changes and I have fixed it up in the kaggle kernel. Its working great to check it once, I see no issue in training Pipeline. It trains well. The issue was in inference pipeline.
Please train on Fridge too and confirm it.
The issue was with image_size which gets overriden by config during inference, I set it manually once again.
Then it ran really well. Also I modified the confidence thresholding code.
It works!!! Thank you a lot @oke-aditya !! I'll be submitting a PR for efficientdet prediction
Actually, I went to double check the solution, and it seems it works even without specifying img_size...
I guess I was doing something wrong before
If it works without specifying Image size then that's amazing. I guess that might happen becoz it creates anchors for that image size. One thing I didn't get, how are we loading state dict in this model. This recursive function does create the model. How does it allocate the weights?
def unwrap_bench(model):
# Unwrap a model in support bench so that various other fns can access the weights and attribs of the
# underlying model directly
if isinstance(model, ModelEma): # unwrap ModelEma
return unwrap_bench(model.ema)
elif hasattr(model, 'module'): # unwrap DDP
return unwrap_bench(model.module)
elif hasattr(model, 'model'): # unwrap Bench -> model
return unwrap_bench(model.model)
else:
return model
In the notebook, the model we're passing is the one we've been training so far =)
Answer is, it doesn't load the weights
Most helpful comment
Just some simple changes and I have fixed it up in the kaggle kernel. Its working great to check it once, I see no issue in training Pipeline. It trains well. The issue was in inference pipeline.
Please train on Fridge too and confirm it.