【问题标题】:Process finished with exit code 139 (interrupted by signal 11: SIGSEGV) with StringSubsequenceKernel使用 StringSubsequenceKernel 以退出代码 139(被信号 11:SIGSEGV 中断)完成的进程
【发布时间】:2017-11-03 19:06:57
【问题描述】:

我很长时间尝试安装 shogun 库以使用 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 目录中,但是这不会。 问题是,为什么我会收到此错误以及如何避免它? 谢谢你的回答。

【问题讨论】:

  • 另外,如果我尝试预测新标签 svm.apply(test_features).get_labels() 得到同样的错误

标签: python python-2.7 shogun


【解决方案1】:

你用的shogun是什么版本的?

【讨论】:

  • 我安装的是libshogun16版本
  • 刚刚发生的另一个有趣的事情是我更新了我的系统,知道我不能导入 StringsubsecuenceKernel 但我可以导入 SubsecuenceStringKernel
  • 首先我会使用 libshogun17 或 libshogun18。您的操作系统/发行版是哪个?也许我可以帮助您弄清楚如何轻松获得这些
  • 对可怕的正字法感到抱歉,我刚刚阅读了我所写的内容。我没有安装 18 或 17,因为当我按照 Shogun 网站上的所有说明进行操作时,它们并没有出现。只是 16。我的操作系统/发行版是 ubuntu 16.04lts。非常感谢。
  • 您使用的是 ppa?如果没有,请考虑使用:launchpad.net/~shogun-toolbox/+archive/ubuntu/stable
猜你喜欢
  • 2021-09-12
  • 2020-07-02
  • 2020-12-05
  • 2018-08-31
  • 2018-05-03
  • 2021-04-02
  • 2019-11-25
  • 2022-01-26
相关资源
最近更新 更多