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]: paddlenlp 3.0.0b1版本使用uie-m-base报错找不到static/inference.pdmodel #9646

Open
summeryqliu opened this issue Dec 17, 2024 · 2 comments
Assignees
Labels
question Further information is requested

Comments

@summeryqliu
Copy link

summeryqliu commented Dec 17, 2024

请提出你的问题

CPU版本运行官方示例:

from pprint import pprint
from paddlenlp import Taskflow
schema = schema = ['Time', 'Player', 'Competition', 'Score']# Define the schema for entity extraction
ie = Taskflow('information_extraction', schema=schema, model="uie-m-base", schema_lang="en")
pprint(ie("2月8日上午北京冬奥会自由式滑雪女子大跳台决赛中中国选手谷爱凌以188.25分获得金牌!")) # B

报错提示:

Traceback (most recent call last):
  File "/home/yqliu/liuyu_qing/work/study/paddle/PaddleNLP-3.0.0-beta2/legacy/model_zoo/uie/a.py", line 4, i
    ie = Taskflow('information_extraction', schema=schema, model="uie-m-base", schema_lang="en")
  File "/home/yqliu/anaconda3/envs/uie/lib/python3.9/site-packages/paddlenlp/taskflow/taskflow.py", line 809
    self.task_instance = task_class(
  File "/home/yqliu/anaconda3/envs/uie/lib/python3.9/site-packages/paddlenlp/taskflow/information_extraction
    self._get_inference_model()
  File "/home/yqliu/anaconda3/envs/uie/lib/python3.9/site-packages/paddlenlp/taskflow/task.py", line 372, in
    self._prepare_static_mode()
  File "/home/yqliu/anaconda3/envs/uie/lib/python3.9/site-packages/paddlenlp/taskflow/task.py", line 227, in
    self.predictor = paddle.inference.create_predictor(self._config)
RuntimeError: (NotFound) Cannot open file /home/yqliu/.paddlenlp/taskflow/information_extraction/uie-m-base/hether the file is normal.

使用uie-base、uie-base-en模型无问题,混合模型uie-m-base报错,基于uie-m-base微调了一个新模型,微调模型可以执行评估代码eval.py,但是使用taskflow也报相同的错误。

环境信息:

# Name                    Version                   Build  Channel
paddle2onnx               1.3.1                    pypi_0    pypi
paddlefsl                 1.1.0                    pypi_0    pypi
paddlenlp                 3.0.0b1                  pypi_0    pypi
paddlepaddle              3.0.0b1         py39_cpu_many_linux    paddle
@summeryqliu summeryqliu added the question Further information is requested label Dec 17, 2024
@fresh-meet
Copy link

fresh-meet commented Dec 17, 2024

Traceback (most recent call last):
  File "/home/XXX/code/PaddleNLP-develop/slm/model_zoo/uie/uie_worlflow.py", line 12, in <module>
    ie = Taskflow('information_extraction', schema=schema, model='uie-base',task_path='./checkpoint/model_best')
  File "/home/XXX/miniconda3/envs/paddle/lib/python3.9/site-packages/paddlenlp/taskflow/taskflow.py", line 809, in __init__
    self.task_instance = task_class(
  File "/home/XXX/miniconda3/envs/paddle/lib/python3.9/site-packages/paddlenlp/taskflow/information_extraction.py", line 536, in __init__
    self._get_inference_model()
  File "/home/XXX/miniconda3/envs/paddle/lib/python3.9/site-packages/paddlenlp/taskflow/task.py", line 371, in _get_inference_model
    self._config = paddle.inference.Config(self._static_model_file, self._static_params_file)
RuntimeError: (NotFound) Cannot open file ./checkpoint/model_best/static/inference.pdmodel, please confirm whether the file is normal.
  [Hint: Expected paddle::inference::IsFileExists(prog_file_) == true, but received paddle::inference::IsFileExists(prog_file_):0 != true:1.] (at ../paddle/fluid/inference/api/analysis_config.cc:111)

========================
使用finetune脚本训练的新模型同样有这样的问题,似乎finetune使用的模型和workflow的模型不一致,请教一下是不是有冲突,怎么解决?

@Fantasy-02
Copy link

先设置环境变量
export FLAGS_enable_pir_api=0
再进行微调试试

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

4 participants