PaddlePaddle / PaddleNLP

👑 Easy-to-use and powerful NLP and LLM library with 🤗 Awesome model zoo, supporting wide-range of NLP tasks from research to industrial applications, including 🗂Text Classification, 🔍 Neural Search, ❓ Question Answering, ℹ️ Information Extraction, 📄 Document Intelligence, 💌 Sentiment Analysis etc.
https://paddlenlp.readthedocs.io
Apache License 2.0
11.94k stars 2.91k forks source link

[Bug]:UIE-X-base模型微调报错 #8489

Closed lululiu2323 closed 1 month ago

lululiu2323 commented 3 months ago

软件环境

- paddlepaddle:2.6.1
- paddlepaddle-gpu: A5000
- paddlenlp:

重复问题

错误描述

我在使用UIE-X-base模型做微调时,报错如下: 
 File "/home/paddlepaddle/PaddleNLP-develop/model_zoo/uie/utils.py", line 673, in convert_example
    "token_type_ids": encoded_inputs["token_type_ids"],
KeyError: 'token_type_ids'

稳定复现步骤 & 代码

λ 0c5ed3f0e08d /home/paddlepaddle/PaddleNLP-develop/model_zoo/uie python finetune.py --device gpu --logging_steps 100 --save_steps 100 --eval_steps 25 --seed 42 --model_name_or_path /home/paddlepaddle/PaddleNLP-develop/model_zoo/uie/UIE-X-Base --output_dir ./checkpointUieX/model_best --train_path document/train.txt --dev_path document/dev.txt --per_device_train_batch_size 8 --per_device_eval_batch_size 8 --num_train_epochs 5 --learning_rate 1e-5 --label_names 'start_positions' 'end_positions' --do_train --do_eval --do_export --export_model_dir /home/paddlepaddle/PaddleNLP-develop/model_zoo/uie/UIE-X-Base --overwrite_output_dir --disable_tqdm True --metric_for_best_model eval_f1 --load_best_model_at_end True --save_total_limit 1

w5688414 commented 3 months ago

降低一下paddle版本试一下,比如2.5.2

soooo6 commented 3 months ago

可以尝试使用applications/information_extraction/document默认用的uie-x-base,我在使用applications/information_extraction/text时遇到了你上述问题

github-actions[bot] commented 1 month ago

This issue is stale because it has been open for 60 days with no activity. 当前issue 60天内无活动,被标记为stale。

github-actions[bot] commented 1 month ago

This issue was closed because it has been inactive for 14 days since being marked as stale. 当前issue 被标记为stale已有14天,即将关闭。