PaddlePaddle uie 报错 求助!!!(疑难杂症)
报错描述
我想使用PaddlePaddle的uie
进行命名实体识别,但是在PaddlePaddle的安装过程中总是出现奇怪的错误,如下所示。使用GPU
版本会报错,使用CPU
版本不会报错但也不会出结果。cuda
版本、cudatoolkit
、cudnn
也都是对的上的。
GPU版本的PaddlePaddle安装
使用的pip install paddlepaddle-gpu==2.6.1.post120
命令进行安装。
安装完成后的paddle.utils.run_check()
也显示正常。
>>> import paddle
>>> paddle.utils.run_check()
Running verify PaddlePaddle program ...
I0621 14:41:17.851310 3808 program_interpreter.cc:212] New Executor is Running.
W0621 14:41:17.851310 3808 gpu_resources.cc:119] Please NOTE: device: 0, GPU Compute Capability: 8.6, Driver API Version: 12.4, Runtime API Version: 12.0
W0621 14:41:18.321316 3808 gpu_resources.cc:164] device: 0, cuDNN Version: 8.6.
I0621 14:41:18.624698 3808 interpreter_util.cc:624] Standalone Executor is Used.
PaddlePaddle works well on 1 GPU.
PaddlePaddle is installed successfully! Let's start deep learning with PaddlePaddle now.
>>>
(paddle_uie_g) PS D:\Rick> nvcc -V
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2023 NVIDIA Corporation
Built on Fri_Jan__6_19:04:39_Pacific_Standard_Time_2023
Cuda compilation tools, release 12.0, V12.0.140
Build cuda_12.0.r12.0/compiler.32267302_0
(paddle_uie_g) PS D:\Rick> nvidia-smi
Fri Jun 21 14:43:31 2024
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 551.61 Driver Version: 551.61 CUDA Version: 12.4 |
|-----------------------------------------+------------------------+----------------------+
| GPU Name TCC/WDDM | Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|=========================================+========================+======================|
| 0 NVIDIA RTX A5000 WDDM | 00000000:73:00.0 On | Off |
| 30% 30C P8 14W / 230W | 1274MiB / 24564MiB | 2% Default |
| | | N/A |
+-----------------------------------------+------------------------+----------------------+
+-----------------------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=========================================================================================|
| 0 N/A N/A 7180 C+G ...on\126.0.2592.61\msedgewebview2.exe N/A |
| 0 N/A N/A 7760 C+G C:\Windows\explorer.exe N/A |
| 0 N/A N/A 11200 C+G ...CBS_cw5n1h2txyewy\TextInputHost.exe N/A |
| 0 N/A N/A 17004 C+G ...l\Microsoft\Teams\current\Teams.exe N/A |
| 0 N/A N/A 17024 C+G ...5n1h2txyewy\ShellExperienceHost.exe N/A |
| 0 N/A N/A 17948 C+G ....Search_cw5n1h2txyewy\SearchApp.exe N/A |
| 0 N/A N/A 18188 C+G ...crosoft\Edge\Application\msedge.exe N/A |
| 0 N/A N/A 18988 C+G ...ekyb3d8bbwe\PhoneExperienceHost.exe N/A |
| 0 N/A N/A 19540 C+G ...t.LockApp_cw5n1h2txyewy\LockApp.exe N/A |
| 0 N/A N/A 19816 C+G ...l\Microsoft\Teams\current\Teams.exe N/A |
| 0 N/A N/A 21404 C+G C:\Program Files\Zoom\bin\Zoom.exe N/A |
| 0 N/A N/A 21724 C+G ...les\Microsoft OneDrive\OneDrive.exe N/A |
| 0 N/A N/A 30756 C ...a22\envs\paddle_uie_g_v3\python.exe N/A |
+-----------------------------------------------------------------------------------------+
GPU版本的PaddlePaddle安装
使用的pip install paddlepaddle
命令进行安装。
测试代码
from pprint import pprint
from paddlenlp import Taskflow
schema = ['Person', 'Organization']
# ie_en = Taskflow('information_extraction', schema=schema, model='uie-base-en')
model_path = r'D:\xxx\xxxxx\model_paddle\uie-base-en' # 我的模型路径
ie_en = Taskflow('information_extraction', schema=schema, task_path=model_path)
pprint(ie_en('In 1997, Steve was excited to become the CEO of Apple.'))
报错信息(paddlepaddle-gpu)gpu版
Error: C:\home\workspace\Paddle\paddle\phi\kernels\gpu\embedding_kernel.cu:40 Assertion `id >= 0` failed. Id should no less than 0 but received an id value: -9223341250425319966.
Error: C:\home\workspace\Paddle\paddle\phi\kernels\gpu\embedding_kernel.cu:40 Assertion `id >= 0` failed. Id should no less than 0 but received an id value: -9223341250425319966.
Error: C:\home\workspace\Paddle\paddle\phi\kernels\gpu\embedding_kernel.cu:40 Assertion `id >= 0` failed. Id should no less than 0 but received an id value: -9223341250425319966.
Error: C:\home\workspace\Paddle\paddle\phi\kernels\gpu\embedding_kernel.cu:40 Assertion `id >= 0` failed. Id should no less than 0 but received an id value: -9223341250425319966.
Error: C:\home\workspace\Paddle\paddle\phi\kernels\gpu\embedding_kernel.cu:40 Assertion `id >= 0` failed. Id should no less than 0 but received an id value: -9223341250425319966.
Error: C:\home\workspace\Paddle\paddle\phi\kernels\gpu\embedding_kernel.cu:40 Assertion `id >= 0` failed. Id should no less than 0 but received an id value: -9223341250425319966.
Error: C:\home\workspace\Paddle\paddle\phi\kernels\gpu\embedding_kernel.cu:40 Assertion `id >= 0` failed. Id should no less than 0 but received an id value: -9223341250425319966.
Error: C:\home\workspace\Paddle\paddle\phi\kernels\gpu\embedding_kernel.cu:40 Assertion `id >= 0` failed. Id should no less than 0 but received an id value: -9223341250425319966.
Error: C:\home\workspace\Paddle\paddle\phi\kernels\gpu\embedding_kernel.cu:40 Assertion `id >= 0` failed. Id should no less than 0 but received an id value: -9223341250425319966.
Error: C:\home\workspace\Paddle\paddle\phi\kernels\gpu\embedding_kernel.cu:40 Assertion `id >= 0` failed. Id should no less than 0 but received an id value: -9223341250425319966.
Error: C:\home\workspace\Paddle\paddle\phi\kernels\gpu\embedding_kernel.cu:40 Assertion `id >= 0` failed. Id should no less than 0 but received an id value: -9223341250425319966.
Error: C:\home\workspace\Paddle\paddle\phi\kernels\gpu\embedding_kernel.cu:40 Assertion `id >= 0` failed. Id should no less than 0 but received an id value: -9223341250425319966.
Error: C:\home\workspace\Paddle\paddle\phi\kernels\gpu\embedding_kernel.cu:40 Assertion `id >= 0` failed. Id should no less than 0 but received an id value: -9223341250425319966.
Error: C:\home\workspace\Paddle\paddle\phi\kernels\gpu\embedding_kernel.cu:40 Assertion `id >= 0` failed. Id should no less than 0 but received an id value: -9223341250425319966.
Error: C:\home\workspace\Paddle\paddle\phi\kernels\gpu\embedding_kernel.cu:40 Assertion `id >= 0` failed. Id should no less than 0 but received an id value: -9223341250425319966.
Traceback (most recent call last):
File "C:\Program Files\JetBrains\PyCharm Community Edition 2022.2.3\plugins\python-ce\helpers\pydev\pydevd.py", line 1496, in _exec
pydev_imports.execfile(file, globals, locals) # execute the script
File "C:\Program Files\JetBrains\PyCharm Community Edition 2022.2.3\plugins\python-ce\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "D:\Rick\NER_Automotive\ner_paddle_uie_g\test.py", line 9, in <module>
pprint(ie_en('In 1997, Steve was excited to become the CEO of Apple.'))
File "C:\Software\anaconda22\envs\paddle_uie_g_v3\lib\site-packages\paddlenlp\taskflow\taskflow.py", line 817, in __call__
results = self.task_instance(inputs, **kwargs)
File "C:\Software\anaconda22\envs\paddle_uie_g_v3\lib\site-packages\paddlenlp\taskflow\task.py", line 527, in __call__
outputs = self._run_model(inputs, **kwargs)
File "C:\Software\anaconda22\envs\paddle_uie_g_v3\lib\site-packages\paddlenlp\taskflow\information_extraction.py", line 1068, in _run_model
results = self._multi_stage_predict(_inputs)
File "C:\Software\anaconda22\envs\paddle_uie_g_v3\lib\site-packages\paddlenlp\taskflow\information_extraction.py", line 1166, in _multi_stage_predict
result_list = self._single_stage_predict(examples)
File "C:\Software\anaconda22\envs\paddle_uie_g_v3\lib\site-packages\paddlenlp\taskflow\information_extraction.py", line 979, in _single_stage_predict
self.predictor.run()
OSError: (External) CUDA error(719), unspecified launch failure.
[Hint: 'cudaErrorLaunchFailure'. An exception occurred on the device while executing a kernel. Common causes include dereferencing an invalid device pointerand accessing out of bounds shared memory. Less common cases can be system specific - more information about these cases canbe found in the system specific user guide. This leaves the process in an inconsistent state and any further CUDA work willreturn the same error. To continue using CUDA, the process must be terminated and relaunched.] (at ..\paddle\fluid\platform\device\gpu\gpu_info.cc:124)
[operator < multihead_matmul > error]
报错信息(paddlepaddle)cpu版
C:\Software\anaconda22\envs\paddle_uie_c\lib\site-packages\_distutils_hack\__init__.py:26: UserWarning: Setuptools is replacing distutils.
warnings.warn("Setuptools is replacing distutils.")
[2024-06-21 14:54:25,047] [ INFO] - We are using <class 'paddlenlp.transformers.ernie.tokenizer.ErnieTokenizer'> to load 'D:\Rick\model\model_paddle\uie-base-en'.
C:\Software\anaconda22\envs\paddle_uie_c\lib\site-packages\paddlenlp\transformers\tokenizer_utils_base.py:2478: FutureWarning: The `max_seq_len` argument is deprecated and will be removed in a future version, please use `max_length` instead.
warnings.warn(
C:\Software\anaconda22\envs\paddle_uie_c\lib\site-packages\paddlenlp\transformers\tokenizer_utils_base.py:1878: FutureWarning: The `pad_to_max_length` argument is deprecated and will be removed in a future version, use `padding=True` or `padding='longest'` to pad to the longest sequence in the batch, or use `padding='max_length'` to pad to a max length. In this case, you can give a specific length with `max_length` (e.g. `max_length=45`) or leave max_length to None to pad to the maximal input size of the model (e.g. 512 for Bert).
warnings.warn(
Process finished with exit code -1073741819 (0xC0000005)