You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
with Segmentor(os.path.join(MODELDIR, "cws.model")) as s:`
如何复现这一错误
只需加载模型就会报错,报错内容: Segmentor.load(r'C:\Users\Qiu\Code\GitHubProject\ltp_pj\ltp_data\cws.model') Traceback (most recent call last): File "<input>", line 1, in <module> Boost.Python.ArgumentError: Python argument types in Segmentor.load(str) did not match C++ signature: load(struct Segmentor {lvalue}, class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)
或 Traceback (most recent call last): File "C:/Users/Qiu/Code/GitHubProject/ltp_pj/example.py", line 20, in <module> with Segmentor(os.path.join(MODELDIR, "cws.model")) as s: Boost.Python.ArgumentError: Python argument types in Segmentor.__init__(Segmentor, str) did not match C++ signature: __init__(struct _object * __ptr64)
问题类型
模型加载错误
出错场景
加载模型时,如:
代码片段
`Segmentor.load(r'C:\Users\Qiu\Code\GitHubProject\ltp_pj\ltp_data\cws.model')
with Segmentor(os.path.join(MODELDIR, "cws.model")) as s:`
如何复现这一错误
只需加载模型就会报错,报错内容:
Segmentor.load(r'C:\Users\Qiu\Code\GitHubProject\ltp_pj\ltp_data\cws.model') Traceback (most recent call last): File "<input>", line 1, in <module> Boost.Python.ArgumentError: Python argument types in Segmentor.load(str) did not match C++ signature: load(struct Segmentor {lvalue}, class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)
或
Traceback (most recent call last): File "C:/Users/Qiu/Code/GitHubProject/ltp_pj/example.py", line 20, in <module> with Segmentor(os.path.join(MODELDIR, "cws.model")) as s: Boost.Python.ArgumentError: Python argument types in Segmentor.__init__(Segmentor, str) did not match C++ signature: __init__(struct _object * __ptr64)
运行环境
python 原生3.6版本
VC++ 2015
已安装boost库并设置了环境变量
模型MD5正确
能够使用ltp进行分词等操作
期望结果
修复bug
其他
The text was updated successfully, but these errors were encountered: