进程完成,退出代码 139(被信号 11 中断:SIGSEGV)与字符串子序列内核



我花了很长时间尝试安装幕府库来使用 StringSubsecuenceKernel。 最后我为 Python 2.7 做了它.我使用了来自本网站另一个答案的代码示例

from shogun.Features import *
from shogun.Kernel import *
from shogun.Classifier import *
from shogun.Evaluation import *
from modshogun import StringCharFeatures, RAWBYTE
from shogun.Kernel import StringSubsequenceKernel
import numpy
strings = ['cat', 'doom', 'car', 'boom']
test = ['bat', 'soon']
train_labels  = numpy.array([1, -1, 1, -1])
test_labels = numpy.array([1, -1])
features = StringCharFeatures(strings, RAWBYTE)
test_features = StringCharFeatures(test, RAWBYTE)
# 1 is n and 0.5 is lambda as described in Lodhi 2002
sk = StringSubsequenceKernel(features, features, 2, 0.5)

然后当我尝试这样做时

del sk

它给了我以下错误

Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)

我正在使用 pycharm 社区版 2017.2.4幕府将军图书馆安装在/usr/lib/python2.7/dist-packages/shogun 通常,已安装的软件包出现在/usr/local/lib/python2.7/dist-packages 目录中,但事实并非如此。问题是,为什么我会收到此错误以及如何避免它?谢谢你的回答。

您使用的幕府将军版本是什么?

最新更新