linux测试xgboost,linux中使用Xgboost的Python脚本:递归地调用terminate,src/data///strtonum.h:141:检查失败:sign==true(0对1...

用户在尝试使用Python的Xgboost库在Linux服务器上从文本文件加载数据时遇到堆栈溢出错误,而在Windows环境下运行相同的脚本则成功。错误信息指向dmlc的数据解析部分,可能与数据格式或编码不兼容有关。
摘要由CSDN通过智能技术生成

我对使用Xgboost或者在shell上编译和构建python脚本完全陌生,可以远程访问服务器的ubuntu14。

所以请原谅我提出这样的问题,因为我还没有找到解决堆栈溢出的方法。在

项目目标是在python中使用xgboost从用户行为数据中提取特征。为了测试xgboost的加载数据,我只编写了一个简短的脚本,如下所示。在import sys

import numpy as np

import scipy.sparse

import pickle

import xgboost as xgb

# /home/mjoys/user_profile

dtrain = xgb.DMatrix('/home/mjoys/user_profile/data/goods_items/textdata.txt')

print dtrain

因为我是在Linux下构建python文件的新手,所以我在windows中又做了一次环境windows和Linux中的脚本基本相同,只是目录不同。在

^{pr2}$

令我惊讶的是,windows脚本的编译是成功的,而Linux脚本却出错了。

你能看看它,告诉我Linux版有什么问题吗?

谢谢。在

windows结果:D:\Anaconda2\python.exe "E:/user profile/test_xgboost/test1"

143x0 matrix with 0 entries is loaded from E:/user

profile/test_xgboost/data/goods_items/textdata.txt

Process finished with exit code 0

Linux结果:mjoys@ml001:~/user_profile$ python ./test.py

[17:27:04] dmlc-core/include/dmlc/logging.h:300: [17:27:04]

src/data/././strtonum.h:141: Check failed: sign == true (0 vs. 1)

Stack trace returned 6 entries:

[bt] (0) /usr/local/lib/python2.7/dist-packages/xgboost-0.6-

py2.7.egg/xgboost/libxgboost.so(_ZN4dmlc15LogMessageFatalD1Ev+0x39)

[0x7fb75b398279]

[bt] (1) /usr/local/lib/python2.7/dist-packages/xgboost-0.6-

py2.7.egg/xgboost/libxgboost.so(_ZN4dmlc4data9strtouintIiEET_PKcPPci+0xd4)

[0x7fb75b4ecbd4]

[bt] (2) /usr/local/lib/python2.7/dist-packages/xgboost-0.6- py2.7.egg/xgboost/libxgboost.so(_ZN4dmlc4data12LibSVMParserIjE10ParseBlockEPcS3_PNS0_17RowBlockContainerIjEE+0x171) [0x7fb75b4fdb81]

[bt] (3) /usr/lib/x86_64-linux-gnu/libgomp.so.1(+0x834a) [0x7fb75b12734a]

[bt] (4) /lib/x86_64-linux-gnu/libpthread.so.0(+0x8184) [0x7fb765b95184]

[bt] (5) /lib/x86_64-linux-gnu/libc.so.6(clone+0x6d) [0x7fb7658c2bed]

[17:27:04] dmlc-core/include/dmlc/logging.h:300: [17:27:04] src/data/././strtonum.h:141: Check failed: sign == true (0 vs. 1)

Stack trace returned 6 entries:

[bt] (0) /usr/local/lib/python2.7/dist-packages/xgboost-0.6-py2.7.egg/xgboost/libxgboost.so(_ZN4dmlc15LogMessageFatalD1Ev+0x39) [0x7fb75b398279]

[bt] (1) /usr/local/lib/python2.7/dist-packages/xgboost-0.6-py2.7.egg/xgboost/libxgboost.so(_ZN4dmlc4data9strtouintIiEET_PKcPPci+0xd4) [0x7fb75b4ecbd4]

[bt] (2) /usr/local/lib/python2.7/dist-packages/xgboost-0.6-py2.7.egg/xgboost/libxgboost.so(_ZN4dmlc4data12LibSVMParserIjE10ParseBlockEPcS3_PNS0_17RowBlockContainerIjEE+0x171) [0x7fb75b4fdb81]

[bt] (3) /usr/lib/x86_64-linux-gnu/libgomp.so.1(+0x834a) [0x7fb75b12734a]

[bt] (4) /lib/x86_64-linux-gnu/libpthread.so.0(+0x8184) [0x7fb765b95184]

[bt] (5) /lib/x86_64-linux-gnu/libc.so.6(clone+0x6d) [0x7fb7658c2bed]

terminate called after throwing an instance of 'dmlc::Error'

terminate called recursively

what(): [17:27:04] src/data/././strtonum.h:141: Check failed: sign == true (0 vs. 1)

Stack trace returned 6 entries:

[bt] (0) /usr/local/lib/python2.7/dist-packages/xgboost-0.6-py2.7.egg/xgboost/libxgboost.so(_ZN4dmlc15LogMessageFatalD1Ev+0x39) [0x7fb75b398279]

[bt] (1) /usr/local/lib/python2.7/dist-packages/xgboost-0.6-py2.7.egg/xgboost/libxgboost.so(_ZN4dmlc4data9strtouintIiEET_PKcPPci+0xd4) [0x7fb75b4ecbd4]

[bt] (2) /usr/local/lib/python2.7/dist-packages/xgboost-0.6-py2.7.egg/xgboost/libxgboost.so(_ZN4dmlc4data12LibSVMParserIjE10ParseBlockEPcS3_PNS0_17RowBlockContainerIjEE+0x171) [0x7fb75b4fdb81]

[bt] (3) /usr/lib/x86_64-linux-gnu/libgomp.so.1(+0x834a) [0x7fb75b12734a]

[bt] (4) /lib/x86_64-linux-gnu/libpthread.so.0(+0x8184) [0x7fb765b95184]

[bt] (5) /lib/x86_64-linux-gnu/libc.so.6(clone+0x6d) [0x7fb7658c2bed]

[17:27:04] dmlc-core/include/dmlc/logging.h:300: [17:27:04] src/data/././strtonum.h:141: Check failed: sign == true (0 vs. 1)

Stack trace returned 6 entries:

[bt] (0) /usr/local/lib/python2.7/dist-packages/xgboost-0.6-py2.7.egg/xgboost/libxgboost.so(_ZN4dmlc15LogMessageFatalD1Ev+0x39) [0x7fb75b398279]

[bt] (1) /usr/local/lib/python2.7/dist-packages/xgboost-0.6-py2.7.egg/xgboost/libxgboost.so(_ZN4dmlc4data9strtouintIiEET_PKcPPci+0xd4) [0x7fb75b4ecbd4]

[bt] (2) /usr/local/lib/python2.7/dist-packages/xgboost-0.6-py2.7.egg/xgboost/libxgboost.so(_ZN4dmlc4data12LibSVMParserIjE10ParseBlockEPcS3_PNS0_17RowBlockContainerIjEE+0x171) [0x7fb75b4fdb81]

[bt] (3) /usr/lib/x86_64-linux-gnu/libgomp.so.1(+0x834a) [0x7fb75b12734a]

[bt] (4) /lib/x86_64-linux-gnu/libpthread.so.0(+0x8184) [0x7fb765b95184]

[bt] (5) /lib/x86_64-linux-gnu/libc.so.6(clone+0x6d) [0x7fb7658c2bed]

terminate called recursively

Aborted (core dumped)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值