TypeError: load_state_dict() takes from 2 to 3 positional arguments but 4 were given
The source code is as follows
def generate(self):
self.net = DeepLab(num_classes=self.num_classes, backbone=self.backbone, downsample_factor=self.downsample_factor, pretrained=False)
    device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
    self.net.load_state_dict(torch.load(self.model_path, map_location=device), ['state_dict'], False)
    self.net    = self.net.eval()
    print('{} model, and classes loaded.'.format(self.model_path))
    
    if self.cuda:
        self.net = nn.DataParallel(self.net)
        self.net = self.net.cuda()