baidu / baidu/DDParser

GPU版本的ddp.parse报错

Open
#57 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
999
Forks
156
PR merge metrics
No merged PRs in 30d

Description

# Environment info
Platform: centos 7
cuda version: 11.2
Python version: 3.8.5
ddparser version: 1.0.6
paddlepaddle version: paddlepaddle-gpu 2.2.1
Using GPU in script?: yes

# To reproduce

- code
```
from ddparser import DDParser

ddp = DDParser(
#encoding_model='transformer'
prob=True, #概率输出
use_pos=True, #词性输出
use_cuda=True
)
ddp.parse(["百度是一家高科技公司"])
```

- output
```
W1221 17:48:36.195587 3303 analysis_predictor.cc:1353] Deprecated. Please use CreatePredictor instead.
Traceback (most recent call last):
File "", line 1, in
File "/home/zhouyuhua/.local/lib/python3.8/site-packages/ddparser/run.py", line 399, in parse
pred_arcs, pred_rels, pred_probs = epoch_predict(self.env, self.args, self.model, dataset.loader)
File "/home/zhouyuhua/.conda/envs/paddle/lib/python3.8/site-packages/decorator.py", line 232, in fun
return caller(func, *(extras + args), **kw)
File "/home/zhouyuhua/.conda/envs/paddle/lib/python3.8/site-packages/paddle/fluid/dygraph/base.py", line 276, in __impl__
return func(*args, **kwargs)
File "/home/zhouyuhua/.local/lib/python3.8/site-packages/ddparser/parser/model.py", line 201, in epoch_predict
arc_probs = nn.index_sample(layers.softmax(s_arc, -1), layers.unsqueeze(arc_preds, -1))
File "/home/zhouyuhua/.conda/envs/paddle/lib/python3.8/site-packages/paddle/fluid/layers/nn.py", line 1337, in softmax
return _C_ops.softmax(input, 'axis', axis, 'use_cudnn', use_cudnn)
ValueError: (InvalidArgument) softmax(): argument (position 4) must be bool, but got int (at /paddle/paddle/fluid/pybind/op_function.h:260)

```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with parser/model.py in epoch_predict, where the traceback reaches the softmax call, and compare it with the PaddlePaddle 2.2.1 API used in the reported CentOS 7, CUDA 11.2 environment. Reproduce the GPU example from the issue; done means ddp.parse completes successfully with use_cuda=True and returns its expected outputs.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.