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

没有任何更改的官方教程运行错误 #2341

Open
sealoongleft opened this issue Jan 2, 2025 · 0 comments
Open

没有任何更改的官方教程运行错误 #2341

sealoongleft opened this issue Jan 2, 2025 · 0 comments
Assignees

Comments

@sealoongleft
Copy link

环境:在BML codelab中的vscode运行的代码,使用的全部默认配置

code如下:

import paddlehub as hub
lac = hub.Module(name="lac")
test_text = ["今天是个好天气。"]
results = lac.cut(text=test_text, use_gpu=False, batch_size=1, return_tag=True)
print(results)
#{'word': ['今天', '是', '个', '好天气', '。'], 'tag': ['TIME', 'v', 'q', 'n', 'w']}

报错内容如下:
File "/home/aistudio/.paddlehub/modules/lac/module.py", line 208, in cut
predictor.run()
ValueError: In user code:

InvalidArgumentError: The type of data we are trying to retrieve (float32) does not match the type of data (int64) currently contained in the container.
  [Hint: Expected dtype() == phi::CppTypeToDataType<T>::Type(), but received dtype():9 != phi::CppTypeToDataType<T>::Type():10.] (at ../paddle/phi/core/dense_tensor.cc:160)
  [operator < pd_kernel.phi_kernel > error]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants