我对使用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)