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] Error loading inference after model fine-tuning 模型微调后加载时出错 #40

Open
LittleGreenYuan opened this issue Feb 27, 2024 · 1 comment
Labels
question Further information is requested

Comments

@LittleGreenYuan
Copy link

What is your question?

问题:模型微调后加载时出错
Question: Error loading inference after model fine-tuning

RuntimeError: SequenceLabelingPipeline: SequenceLabelingModel: Error(s) in loading state_dict for SequenceLabelingModel:
Missing key(s) in state_dict: "embedder.transformer_model.embeddings.position_ids".

What have you tried?

我完全按照官方教程进行的微调,没有进行额外的代码修改,自动保存的微调模型无法加载。
I completely followed the official tutorial for fine-tuning without making any additional code modifications, and the automatically saved fine-tuning model cannot be loaded.

Code (if necessary)

Code:
python```
from modelscope.pipelines import pipeline
from modelscope.utils.constant import Tasks
p = pipeline(
Tasks.named_entity_recognition,
'/root/experiments/experiments/CMeEE-cmeee/20240227_093521/output_best'
)
result = p('对儿童SARST细胞亚群的研究表明,与成人SARS相比,儿童细胞下降不明显,证明上述推测成立。')
print(result)


### What's your environment?

- AdaSeq Version (e.g., 1.0 or master): 0.6.6
- ModelScope Version (e.g., 1.0 or master): 1.12.0
- PyTorch Version (e.g., 1.12.1): 2.2.1
- OS (e.g., Ubuntu 20.04): Ubuntu 20.04
- Python version: 3.11
- CUDA/cuDNN version: 
- GPU models and configuration: RTX3090
- Any other relevant information:


### Code of Conduct

- [X] I agree to follow this project's Code of Conduct
@LittleGreenYuan LittleGreenYuan added the question Further information is requested label Feb 27, 2024
@LittleGreenYuan
Copy link
Author

不要用Jupyter notebook去加载

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

1 participant