PaddlePaddle uie 报错 求助!!!(疑难杂症)

报错描述

我想使用PaddlePaddleuie进行命名实体识别,但是在PaddlePaddle的安装过程中总是出现奇怪的错误,如下所示。使用GPU版本会报错,使用CPU版本不会报错也不会出结果。cuda版本、cudatoolkitcudnn也都是对的上的。

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)
  • 4
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
PaddlePaddle是一个开源的深度学习平台,可以用于构建和训练深度学习模型。如果你想使用PaddlePaddle,可以通过源码编译的方式来安装。首先,你需要在Git Bash中执行以下两条命令来将PaddlePaddle的源码克隆到本地,并进入Paddle目录: ``` git clone https://github.com/PaddlePaddle/Paddle.git cd Paddle ``` 接下来,你可以根据自己的需求进行编译。如果你使用的是Windows系统,可以使用源码编译来安装符合你需求的PaddlePaddle版本。具体的编译步骤可以参考官方文档中的Windows下源码编译部分\[2\]。 如果你想在docker镜像中编译PaddlePaddle,可以使用以下命令启动docker镜像并进行编译。如果你需要编译CPU版本,可以使用以下命令: ``` sudo docker run --name paddle-test -v $PWD:/paddle --network=host -it hub.baidubce.com/paddlepaddle/paddle:latest-dev /bin/bash ``` 如果你需要编译GPU版本,可以使用以下命令: ``` sudo nvidia-docker run --name paddle-test -v $PWD:/paddle --network=host -it hub.baidubce.com/paddlepaddle/paddle:latest-dev /bin/bash ``` 以上是关于使用源码编译PaddlePaddle的一些基本步骤和命令。你可以根据自己的需求和操作系统选择适合的方式来安装PaddlePaddle。 #### 引用[.reference_title] - *1* *2* *3* [《PaddlePaddle从入门到炼丹》一——新版本PaddlePaddle的安装](https://blog.csdn.net/qq_33200967/article/details/83052060)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值