Remove the fc layer parameters from state_dict.
(state_dict)
| 148 | |
| 149 | |
| 150 | def remove_fc(state_dict): |
| 151 | """Remove the fc layer parameters from state_dict.""" |
| 152 | # for key, value in state_dict.items(): |
| 153 | for key, value in list(state_dict.items()): |
| 154 | if key.startswith('fc.'): |
| 155 | del state_dict[key] |
| 156 | return state_dict |
| 157 | |
| 158 | |
| 159 | def resnet18(pretrained=False, **kwargs): |