No, this wouldn’t work as you are replacing self.fc with a new linear layer first and then with a dropout layer. If you want to use both new layers, replace self.fc with an nn.Sequential block containing both layers.
I can’t find any place where the error message is raised, so am unsure what is failing.
Feel free to post a minimal, executable code snippet to reproduce the issue.