You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When executing the code, an error occurs in the compute_loss function in hfutil/hf_trainers.py. The error message is as follows:
Error executing job with overrides: ['data=harry', 'data.dataset.split=None', 'model=llama-2-7b', 'model_mode=uld', 'model_mode.num_layer=8', 'unlearn_loss=remember+uniform', 'trainer.strategy=ddp', 'OUTPUTMODELDIR=../Model/unlearned_model/uld']
Traceback (most recent call last):
File "/home/lenijwp/codes/testUnlearning/unlearning_methods/ULD/scripts/hf_forget_train.py", line 193, in main
trainer.train()
File "/home/lenijwp/.conda/envs/uld/lib/python3.10/site-packages/transformers/trainer.py", line 1624, in train
return inner_training_loop(
File "/home/lenijwp/.conda/envs/uld/lib/python3.10/site-packages/transformers/trainer.py", line 1961, in innertraining_loop
tr_loss_step = self.training_step(model, inputs)
File "/home/lenijwp/.conda/envs/uld/lib/python3.10/site-packages/transformers/trainer.py", line 2902, in training_step
loss = self.compute_loss(model, inputs)
File "/home/lenijwp/codes/testUnlearning/unlearning_methods/ULD/uld/hfutil/hf_trainers.py", line 93, in compute_loss
'trainloss/loss': loss.item(),
RuntimeError: a Tensor with 2 elements cannot be converted to Scalar
When executing the code, an error occurs in the
compute_loss
function inhfutil/hf_trainers.py
. The error message is as follows:The problematic code seems:
To resolve the issue, I needed to replace it with:
The text was updated successfully, but these errors were encountered: