Skip to content

GPU版本的ddp.parse报错 #57

@Yuhuajoe

Description

@Yuhuajoe

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 "<stdin>", line 1, in <module>
  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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions