LasUIE icon indicating copy to clipboard operation
LasUIE copied to clipboard

RuntimeError: element 0 of tensors does not require grad and does not have a grad_fn

Open Whitefish-by opened this issue 1 year ago • 0 comments

When I ran the ner task in multiple GPUs, the program crashed and logging the error messages as the title like. I try to fix the bug and I just find the call of grad_fn function in lines 567 in the run_struct_post_train.py. But when I add the code state.params.requires_grad_(True) orloss.requires_grad_(True) , the program didn't work as well. Hope you can give me some guidances,thanks! The error messages are as follows: image

Whitefish-by avatar Mar 18 '24 14:03 Whitefish-by