DCL
DCL copied to clipboard
how to solve this problem
AttributeError: 'MainModel' object has no attribute 'classifier_swap'
LoadModel.py
if self.use_dcl:
if config.cls_2:
self.classifier_swap = nn.Linear(2048, 2, bias=False)
if config.cls_2xmul:
self.classifier_swap = nn.Linear(2048, 2*self.num_classes, bias=False)
self.Convmask = nn.Conv2d(2048, 1, 1, stride=1, padding=0, bias=True)
self.avgpool2 = nn.AvgPool2d(2, stride=2)
So config.cls_2 or config.cls_2xmul should be True.