AttributeError: 'NoneType' object has no attribute 'to' #1221
Replies: 7 comments 11 replies
-
I have the same problem, I hope someone can answer it, |
Beta Was this translation helpful? Give feedback.
-
我也遇到了这个问题,前面微调正常,后面到了保存点的时候就出现了这个报错。 |
Beta Was this translation helpful? Give feedback.
-
我也遇到了同样的问题。TypeError: BatchEncoding.to() got an unexpected keyword argument 'non_blocking',我的解决方法是将operations.py对应出错的位置上的non_blocking=non_blocking去除,我猜是tensor.to()这个函数并没有对应non_blocking的属性,所以无论true和false都没用。AttributeError: 'NoneType' object has no attribute 'to',这个问题我猜是数据不知道为什么NoneType,所以.to()的时候没法使用,我也不知道该怎么解决,希望有人能帮忙 |
Beta Was this translation helpful? Give feedback.
-
没有,还是一样。这个只能等官方维护了,或者用之前的历史版本。 |
Beta Was this translation helpful? Give feedback.
-
同样的问题,一跑到eval-step的时候就报这个错,当我尝试修改eval-step大于max-step,再次运行时,在进行最后的prediction又报这个错。 |
Beta Was this translation helpful? Give feedback.
-
Got the same problem. |
Beta Was this translation helpful? Give feedback.
-
transformer换成4.40.0亲测有用 |
Beta Was this translation helpful? Give feedback.
-
I split one dataset into
train.json
and 'valid.json', so their format are the same. When I finetune my chatglm3, it throws errorAttributeError: 'NoneType' object has no attribute 'to'
during evaltion. The training succeeded, but evaluating failed.It seems the different way to
get_dataset
infinetune_hf.py
. Theprocess_batch_eval
doesn't generatelabels
, making there are{'labels': None}
in the dataset.Beta Was this translation helpful? Give feedback.
All reactions