DCL icon indicating copy to clipboard operation
DCL copied to clipboard

how to solve this problem

Open lovechenforeverlove opened this issue 4 years ago • 1 comments

AttributeError: 'MainModel' object has no attribute 'classifier_swap'

lovechenforeverlove avatar Oct 14 '20 08:10 lovechenforeverlove

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.

yangxh11 avatar Oct 17 '20 03:10 yangxh11