Skip to content

[Bug]: Taskflow("text_similarity") error #11163

@fjcondy

Description

@fjcondy

软件环境

- paddlepaddle:3.2.1
- paddlenlp: 2.6.1
- paddle2onnx 2.0.1
- paddlefsl 1.1.0
- Python 3.11.13

重复问题

  • I have searched the existing issues

错误描述

>>> from paddlenlp import Taskflow
/home/paddle/.conda/envs/paddle/lib/python3.11/site-packages/paddle/utils/cpp_extension/extension_utils.py:718: UserWarning: No ccache found. Please be aware that recompiling all source files may be required. You can download and install ccache from: https://github.com/ccache/ccache/blob/master/doc/INSTALL.md
  warnings.warn(warning_message)
/home/paddle/.conda/envs/paddle/lib/python3.11/site-packages/_distutils_hack/__init__.py:30: UserWarning: Setuptools is replacing distutils. Support for replacing an already imported distutils is deprecated. In the future, this condition will fail. Register concerns at https://github.com/pypa/setuptools/issues/new?template=distutils-deprecation.yml
  warnings.warn(
/home/paddle/.conda/envs/paddle/lib/python3.11/site-packages/jieba/_compat.py:18: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.
  import pkg_resources

>>> similarity = Taskflow("text_similarity")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/paddle/.conda/envs/paddle/lib/python3.11/site-packages/paddlenlp/taskflow/taskflow.py", line 804, in __init__
    self.task_instance = task_class(
                         ^^^^^^^^^^^
  File "/home/paddle/.conda/envs/paddle/lib/python3.11/site-packages/paddlenlp/taskflow/text_similarity.py", line 175, in __init__
    self._get_inference_model()
  File "/home/paddle/.conda/envs/paddle/lib/python3.11/site-packages/paddlenlp/taskflow/task.py", line 372, in _get_inference_model
    self._prepare_static_mode()
  File "/home/paddle/.conda/envs/paddle/lib/python3.11/site-packages/paddlenlp/taskflow/task.py", line 227, in _prepare_static_mode
    self.predictor = paddle.inference.create_predictor(self._config)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: (Unavailable) Cannot read tensor desc size
  [Hint: Expected is.good() == true, but received is.good():0 != true:1.] (at /paddle/paddle/phi/core/framework/dense_tensor_tostream.cc:316)
  [operator < load_combine > error]

稳定复现步骤 & 代码

from paddlenlp import Taskflow
similarity = Taskflow("text_similarity")

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions