Icevision: Fix efficientdet

Created on 15 Jul 2020  路  6Comments  路  Source: airctic/icevision

馃悰 Bug

Describe the bug
Efficientdet is training, loss is going down as expected, but predictions are messed up.

bug help wanted priority-high

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.

All 6 comments

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lgvaz picture lgvaz  路  3Comments

oke-aditya picture oke-aditya  路  5Comments

bguan picture bguan  路  6Comments

lgvaz picture lgvaz  路  4Comments

RibenaMapleSyrup picture RibenaMapleSyrup  路  3Comments