I’m new to Pytorch and trying to understand why something didn’t break.
Details:


I’m building a model that detects skin cancer given an image (it seems this is a common starter project…) and used a pre-trained Resnet50 model for transfer learning.


I incorrectly added a final fully connected layer like this:
model.fc1 = nn.Linear(1000, 3)
and thought that everything was alright, since Layer fc1 DID show up at the end of the model when I inspected the structure.


I trained the model for 50 epochs over 2000 images that were classified into 3 distinct classes, and after training the model was testing at 68% accuracy. However, I then realized when inspecting the prediction that there were still 1000 output features.


Question:
Should there have been an error or some indication that a mismatch between the output features and data labels was present? How was it able to successfully train to a reasonably reasonably accurate threshold with my mistake?
Thanks!