Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question]: ernie-3-tiny 按文档步骤运行例子报错 #9896

Open
LiSongRan opened this issue Feb 19, 2025 · 0 comments
Open

[Question]: ernie-3-tiny 按文档步骤运行例子报错 #9896

LiSongRan opened this issue Feb 19, 2025 · 0 comments
Assignees
Labels
question Further information is requested

Comments

@LiSongRan
Copy link

请提出你的问题

https://github.com/PaddlePaddle/PaddleNLP/blob/71bfc333ade82abdb05f0348ff00ba00cf3c73d9/slm/model_zoo/ernie-3.0-tiny/README.md

python run_train.py
--device gpu
--logging_steps 100
--save_steps 100
--eval_steps 100
--model_name_or_path ernie-3.0-tiny-nano-v2-zh
--num_train_epochs 30
--per_device_eval_batch_size 64
--per_device_train_batch_size 64
--learning_rate 5e-5
--prune_embeddings
--max_vocab_size 6000
--max_seq_length 16
--output_dir output/BS64_LR5e-5_EPOCHS30
--train_path data/train.txt
--dev_path data/dev.txt
--intent_label_path data/intent_label.txt
--slot_label_path data/slot_label.txt
--label_names 'intent_label' 'slot_label'
--weight_decay 0.01
--warmup_ratio 0.1
--do_train
--do_eval
--do_export
--input_dtype "int32"
--disable_tqdm True
--overwrite_output_dir
--load_best_model_at_end True
--save_total_limit 1
--metric_for_best_model eval_accuracy \

案例子运行报错 报错为:
Traceback (most recent call last):
File "/home2/mns_python_sdk/sequence_ner/PaddleNLP/slm/model_zoo/ernie-3.0-tiny/run_train.py", line 286, in
main()
File "/home2/mns_python_sdk/sequence_ner/PaddleNLP/slm/model_zoo/ernie-3.0-tiny/run_train.py", line 151, in main
model = JointErnie.from_pretrained(
File "/root/anaconda3/envs/py310_sr/lib/python3.10/site-packages/paddlenlp/transformers/model_utils.py", line 2529, in from_pretrained
model, missing_keys, unexpected_keys, mismatched_keys = cls._load_pretrained_model(
File "/root/anaconda3/envs/py310_sr/lib/python3.10/site-packages/paddlenlp/transformers/model_utils.py", line 2216, in _load_pretrained_model
raise RuntimeError(f"Error(s) in loading state_dict for {model.class.name}:\n\t{error_msg}")
RuntimeError: Error(s) in loading state_dict for JointErnie:
Skip loading for ernie.embeddings.word_embeddings.weight. ernie.embeddings.word_embeddings.weight receives a shape [5965, 312], but the expected shape is [6000, 312].
You may consider adding ignore_mismatched_sizes=True in the model from_pretrained method.

@LiSongRan LiSongRan added the question Further information is requested label Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants