Using AdaptiveAvgPool2d(2)
Closed this issue · 0 comments
hamidify commented
What if we use AdaptiveAvgPool2d(2) inorder to avoid the size mismatch error of resnet18 and use the pre-trained model as a checkpoint? It will be like this,
D.fc = nn.Sequential(nn.Linear(2048, 1), nn.Sigmoid())
D.avgpool = nn.AdaptiveAvgPool2d(2)