CSCYQJ / MICCAI23-ProtoContra-SFDA

This is the official code of MICCAI23 paper "Source-Free Domain Adaptation for Medical Image Segmentation via Prototype-Anchored Feature Alignment and Contrastive Learning"
26 stars 6 forks source link

Implementation bug? It seems like the last layer is not frozen? #18

Open BarY7 opened 5 months ago

BarY7 commented 5 months ago

Hey, I noticed that you freeze the last layer with this line:

self.model.outc.requires_grad = False But outc is nn.module, and according to this thread: https://discuss.pytorch.org/t/requires-grad-doesnt-propagate-to-the-parameters-of-the-module/9979/2

And my experience, comparing the source with the after-pfa model, this does not freeze the last layer.

YYinn commented 4 months ago

Hi Bar, I think you're right.