Open
Description
When I use the following code.
trainer.compression_ctrl.multi_elasticity_handler.activate_subnet_for_config(config)
validate_model_fn(trainer.model, eval_loader)
The results are the same during the evaluation regardless of different config.
The same issue will also occur when using the following code for evaluation.
def evaluate_sst2(model, valid_loader):
model.eval()
correct = 0
total = 0
with torch.no_grad():
for batch in valid_loader:
input_ids_sentence = batch['input_ids_sentence'].to(model.device)
attention_mask_sentence = batch['attention_mask_sentence'].to(model.device)
labels = batch['label'].to(model.device)
outputs = model(
input_ids_sentence,
attention_mask=attention_mask_sentence
)
_, predicted= torch.max(outputs.logits, 1)
correct += (predicted == labels).sum().item()
total += labels.size(0)
acc = correct / total
return acc
evaluate_sst(trainer.model, valid_loader)
How to solve the issue? or How to check if the activation of the subnet has been completed?
Metadata
Metadata
Assignees
Labels
No labels