def reweight_cls(model, tauuu):
    if (tauuu == 0):
        return model
    model_dict = model.state_dict()

    def pnorm(weights, tau):
        normB = torch.norm(weights, 2, 1)
        ws = weights.clone()
        for i in range(0, weights.shape[0]):
            ws[i] = (ws[i] / torch.pow(normB[i], tau))
        return ws
    reweight_set = ['bbox_head.fc_cls.weight']
    tau = tauuu
    for k in reweight_set:
        weight = model_dict[k]
        weight = pnorm(weight, tau)
        model_dict[k].copy_(weight)
        print('Reweight param {:<30} with tau={}'.format(k, tau))
    return model
def reweight_cls(model, tauuu):
    if (tauuu == 0):
        return model
    model_dict = model.state_dict()

    def pnorm(weights, tau):
        normB = torch.norm(weights, 2, 1)
        ws = weights.clone()
        for i in range(0, weights.shape[0]):
            ws[i] = (ws[i] / torch.pow(normB[i], tau))
        return ws
    reweight_set = ['bbox_head.fc_cls.weight']
    tau = tauuu
    for k in reweight_set:
        weight = model_dict[k]
        weight = pnorm(weight, tau)
        model_dict[k].copy_(weight)
        print('Reweight param {:<30} with tau={}'.format(k, tau))
    return model