Skip to content

Fix: add missing fc layer and use num_classes in ResNet18/ResNet34#100

Open
abhiram123467 wants to merge 3 commits intohumanai-foundation:mainfrom
abhiram123467:fix-resnet-num-classes
Open

Fix: add missing fc layer and use num_classes in ResNet18/ResNet34#100
abhiram123467 wants to merge 3 commits intohumanai-foundation:mainfrom
abhiram123467:fix-resnet-num-classes

Conversation

@abhiram123467
Copy link

Bug Fix: ResNet18 and ResNet34 classification head

Problems Fixed

  1. num_classes argument accepted but never used in ResNet18/34
  2. No self.fc layer existed — models could not output class predictions
  3. Default num_classes=1000 wrong for RenAIssance (3-class OCR task)

Changes Made

  • ResNet18: num_classes=1000num_classes=3
  • ResNet18: added self.fc = nn.Linear(512 * 32, num_classes)
  • ResNet18: added flatten + fc in forward()
  • ResNet34: same three fixes applied

Closes #91
Closes #71

Adds Setup and How to Run sections to README.md with clear instructions for new contributors.
Updated ResNet18 and ResNet34 to classify 3 classes instead of 1000. Added fully connected layers and flattening before classification.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant