Use self.named_modules() return name is empty


as show in the image,when I want to finetune the net,met the problem,however ,the same code is good before finetune.Thanks for your help

I assume you’ve manipulated the model somehow before executing the mentioned line of code?
If so, could you post the code snippet?

It may be a bug in pytorch,when I use self.mode._modules(), it works…

Could you post a reproducible code snippet, so that we can debug it?