Model stopped training once I introduced << report_to = 'wandb' >> in TrainingArguments

I am downloading the model microsoft/Multilingual-MiniLM-L12-H384 at main microsoft/Multilingual-MiniLM-L12-H384 and then using it.

Transformer Version: ‘4.11.3’

I have written the below code:

import wandb
wandb.login()
%env WANDB_LOG_MODEL=true

model = tr.BertForSequenceClassification.from_pretrained("/home/pc/minilm_model",num_labels=2)
model.to(device)

print("hello")

training_args = tr.TrainingArguments(
report_to = 'wandb',
output_dir='/home/pc/proj/results2', # output directory
num_train_epochs=10, # total number of training epochs
per_device_train_batch_size=16, # batch size per device during training
per_device_eval_batch_size=32, # batch size for evaluation
learning_rate=2e-5,
warmup_steps=1000, # number of warmup steps for learning rate scheduler
weight_decay=0.01, # strength of weight decay
logging_dir='./logs', # directory for storing logs
logging_steps=1000,
evaluation_strategy="epoch",
save_strategy="no"
)

print("hello")

trainer = tr.Trainer(
model=model, # the instantiated 🤗 Transformers model to be trained
args=training_args, # training arguments, defined above
train_dataset=train_data, # training dataset
eval_dataset=val_data, # evaluation dataset
compute_metrics=compute_metrics
)

After Executing this:

The model stuck at this point:

***** Running training *****

Num examples = 12981
 Num Epochs = 20
 Instantaneous batch size per device = 16
 Total train batch size (w. parallel, distributed & accumulation) = 32
 Gradient Accumulation steps = 1
 Total optimization steps = 8120
Automatic Weights & Biases logging enabled, to disable set os.environ["WANDB_DISABLED"] = "true"

What could be the possible solution?

Hi Pratik, thank you for writing in! I see for your compute_metrics argument in your trainer that you are calling compute_metrics, but there’s no function to tell it what to compute. Is this code that you have removed or is this actually missing?

Hi Pratik, I’m just checking up to see if you still have this issue?

Hi Pratik, since we have not heard back from you we are going to close this request. If you would like to re-open the conversation, please let us know!

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.