I’m trying to apply both per-parameter learning rate and weight decay, however, I get an error saying:

some parameters appear in more than one parameter group
Here’s a snippet of my code:

param_optimizer = list(model.named_parameters())
    no_decay = ["bias", "LayerNorm.bias", "LayerNorm.weight"]
    optimizer_parameters = [
        {'params': [p for n, p in param_optimizer if not any(nd in n for nd in no_decay)], 'weight_decay': 0.001},
        {'params': [p for n, p in param_optimizer if any(nd in n for nd in no_decay)], 'weight_decay': 0.0},
        {'params': model.roberta.parameters(), 'lr': lr[0]},        
        {'params': model.last_linear.parameters(), 'lr': lr[1]}    
        
    ]

    optimizer = AdamW(optimizer_parameters)```

I would much appreciate your help!