the heatmap was wrong when used ResNet
Kokoing123 opened this issue · 4 comments
When I used ResNet18~50 to instead the vgg networks,the program get NET RECEPTION{'n':7, 'j':32, 'r':11, 's':0.0, 'img_shape':(3,244,244)} , but get strong sense of grainines heatmaps. The parameters are obviously unreasonable,have you ever run into such a problem?
To correctly track the receptive field, all of the network's layers that alter the receptive field need to implement fcdd.models.bases.ReceptiveModule
and update their receptive field information in the __init__ phase (cf. e.g., fcdd.models.bases.RecConv2d
).
I assume you have used fcdd.models.bases.ReceptiveNet._create_conv2d
and fcdd.models.bases.ReceptiveNet._create_maxpool2d
to build up the network?
Are there other layers that are used and do not implement the ReceptiveModule?
For example, if your network's implementation uses a "Block" module that is made up of conv layers, this block module also needs to implement ReceptiveModule
and update its receptive field (using the info of its conv layers). Otherwise, the information is not propagated.
In general, I'd expect that the receptive field for a Resnet18+ is too large and the heatmaps become too unprecise.
yes,I used the fcdd.models.bases.ReceptiveModule to construct the net work, but I found the receptivefield size is not correct, may be I do something wrong or the residual module was different. But when I specify the receptivefield of the ResNet out layer, the heatmaps looks well, emm..........
anyway, it works now
Glad to hear you got it working. In case you would like to share your implementation and solution, I'll leave this issue open for the moment. Otherwise, feel free to close it.
@Kokoing123 Could you please share your model implementation? I'm working on it and also get the same problem 😢