Closed Benjamin-Etheredge closed 1 month ago
Hey!
I had the same problem, and solved by replace:
if num_classes != 53:
mdl.classifier = nn.Linear(
mdl.classifier.in_features, # type: ignore
num_classes,
)
with:
if num_classes != 53:
mdl.grouper = nn.Conv1d(
in_channels=mdl.grouper.in_channels,
out_channels=num_classes,
kernel_size=1,
)
Now it works fine with different number of classes than the original case.
Old issue almost 1 year old, and with significant code changes and upcoming signal additions, unclear how relevant this problem still is. Closing out for now.
Describe the bug Building XCiT with
num_classes != 53
causes an attribute error onclassifier
.To Reproduce
Expected behavior It to create a model.
Screenshots
Desktop (please complete the following information):
Additional context N/A