fxsjy / jieba

结巴中文分词
MIT License
33.39k stars 6.73k forks source link

AssertionError: In PaddlePaddle 2.x #942

Open kayzhou opened 3 years ago

kayzhou commented 3 years ago

执行 jieba.enable_paddle() 报错

AssertionError: In PaddlePaddle 2.x, we turn on dynamic graph mode by default, and 'data()' is only supported in static graph mode. So if you want to use this api, please call 'paddle.enable_static()' before this api to enter static graph mode.

wllbll commented 1 year ago

在 /jieba/lac_small/predict.py 中的 开头找到

import paddle 在这一行后加入 paddle.enable_static() 就可以解决这个问题了