RuntimeError: element 0 of tensors does not require grad and does not have a grad_fn #834
Replies: 7 comments 2 replies
-
我也遇到了这个情况。请问你finetune后的效果怎么样? |
Beta Was this translation helpful? Give feedback.
-
我也遇到一样的问题。。这样修改后,结果是不对的,完全finetune不出来,所以应该不是这个改法,但是问题的原因还不名。。 |
Beta Was this translation helpful? Give feedback.
-
一样的问题: RuntimeError: element 0 of tensors does not require grad and does not have a grad_fn |
Beta Was this translation helpful? Give feedback.
-
我也遇到了,有人解决了么?怎么处理的啊? |
Beta Was this translation helpful? Give feedback.
-
一样遇到了 |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
try this: |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
运行
finetune_demo/finetune_hf.py
时遇到了这个RuntimeError: element 0 of tensors does not require grad and does not have a grad_fn
报错。(commit hash 9c875fb)查到了这两个issue:
core
] Refactor ofgradient_checkpointing
huggingface/transformers#27020有人遇到这个情况的吗?
我的workaround是注释掉503行的
model.gradient_checkpointing_enable()
。感觉不太对?不过的确finetune成功了。Beta Was this translation helpful? Give feedback.
All reactions