不支持CPU版本的PaddlePaddle
- Dominant language
- Python
- Stars
- 999
- Forks
- 156
- PR merge metrics
- No merged PRs in 30d
Description
使用CPU版本的PaddlePaddle时,会报以下错误
```
In [6]: ddp.parse(["百度是一家高科技公司"])
e[37m--- Fused 0 subgraphs into layer_norm op.e[0m
e[37m--- fused 4 pairs of fc gru patternse[0m
c:\users\31882\.conda\envs\demo\lib\site-packages\paddle\fluid\dygraph\math_op_patch.py:251: UserWarning: The dtype of left and right variables are not the same, left dtype is paddle.int32, but right dtype is paddle.bool, the right dtype will convert to paddle.int32
warnings.warn(
c:\users\31882\.conda\envs\demo\lib\site-packages\paddle\fluid\dygraph\math_op_patch.py:251: UserWarning: The dtype of left and right variables are not the same, left dtype is paddle.float32, but right dtype is paddle.bool, the right dtype will convert to paddle.float32
warnings.warn(
c:\users\31882\.conda\envs\demo\lib\site-packages\paddle\fluid\dygraph\math_op_patch.py:251: UserWarning: The dtype of left and right variables are not the same, left dtype is paddle.float32, but right dtype is paddle.int32, the right dtype will convert to paddle.float32
warnings.warn(
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
in
----> 1 ddp.parse(["百度是一家高科技公司"])
c:\users\31882\.conda\envs\demo\lib\site-packages\ddparser\run.py in parse(self, inputs)
397 sequential_sampler=True if not self.args.buckets else False,
398 )
--> 399 pred_arcs, pred_rels, pred_probs = epoch_predict(self.env, self.args, self.model, dataset.loader)
400
401 if self.args.buckets:
c:\users\31882\.conda\envs\demo\lib\site-packages\decorator.py in fun(*args, **kw)
230 if not kwsyntax:
231 args, kw = fix(args, kw, sig)
--> 232 return caller(func, *(extras + args), **kw)
233 fun.__name__ = func.__name__
234 fun.__doc__ = func.__doc__
c:\users\31882\.conda\envs\demo\lib\site-packages\paddle\fluid\dygraph\base.py in __impl__(func, *args, **kwargs)
274 def __impl__(func, *args, **kwargs):
275 with _switch_tracer_mode_guard_(is_train=False):
--> 276 return func(*args, **kwargs)
277
278 return __impl__(func)
c:\users\31882\.conda\envs\demo\lib\site-packages\ddparser\parser\model.py in epoch_predict(env, args, model, loader)
199 rels.extend(layers.split(nn.masked_select(rel_preds, mask), lens.numpy().tolist()))
200 if args.prob:
--> 201 arc_probs = nn.index_sample(layers.softmax(s_arc, -1), layers.unsqueeze(arc_preds, -1))
202 probs.extend(
203 layers.split(
c:\users\31882\.conda\envs\demo\lib\site-packages\paddle\fluid\layers\nn.py in softmax(input, use_cudnn, name, axis)
1335
1336 if in_dygraph_mode():
-> 1337 return _C_ops.softmax(input, 'axis', axis, 'use_cudnn', use_cudnn)
1338
1339 inputs = {"X": [input]}
ValueError: (InvalidArgument) softmax(): argument (position 4) must be bool, but got int (at C:\home\workspace\Paddle_release\paddle/fluid/pybind/op_function.h:260)
```
可以修复一下吗,感谢
Contributor guide
No contributing guide indexed for this repository
Research direction
Reproduce the failure through ddp.parse, then trace the call from ddparser/run.py parse to ddparser/parser/model.py epoch_predict and the softmax call shown in the traceback. Check CPU execution with the reported PaddlePaddle setup; done means parsing the sample sentence completes without the ValueError.
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
- Mostly clear
- Newbie friendliness
- 35/100