lukemelas / EfficientNet-PyTorch

A PyTorch implementation of EfficientNet
Apache License 2.0
7.86k stars 1.52k forks source link

More issues with Gradcam #267

Open virilo opened 3 years ago

virilo commented 3 years ago

I've found this issue https://github.com/lukemelas/EfficientNet-PyTorch/issues/184 but it's about a checkboard effect. And it's not my case.

I'm using GradCAM and GradCAM++ to EfficientNet-B0 layer model._blocks[-1]._project_conv

And the results are weird, like shifted:

efficientnet-b0-issue

One try, using this implementation:

Another try, trying to reproduce this script Results and more shifted images here

The previous Kaggle script is dated 2019/06/05. It seems that GradCAM worked with efficientnet_pytorch these days

ORippler commented 3 years ago

You could try downgrading to efficientnet-pytorch==0.6.3. We are working on a different problem, and noticed the same "shift to the bottom right" phenomenon with efficientnet-pytorch==0.7.0 (which is not present in efficientnet-pytorch==0.6.3).

Possible reason might be this PR, which modified the way zero-padding is performed. Maybe it introduced a Bug here ?

CCing @lukemelas