Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/324.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
linux中使用Xgboost的Python脚本:递归调用terminate,src/data//strtonum.h:141:Check failed:sign==true(0对1)_Python_Linux_Ubuntu_Xgboost - Fatal编程技术网

linux中使用Xgboost的Python脚本:递归调用terminate,src/data//strtonum.h:141:Check failed:sign==true(0对1)

linux中使用Xgboost的Python脚本:递归调用terminate,src/data//strtonum.h:141:Check failed:sign==true(0对1),python,linux,ubuntu,xgboost,Python,Linux,Ubuntu,Xgboost,我对使用Xgboost或者在shell上编译和构建python脚本是完全陌生的,可以远程访问服务器的Ubuntu14。 所以请原谅我问了这样的问题,因为我还没有找到解决堆栈溢出的方法 该项目的目标是在python中使用xgboost在用户行为数据中提取特征。为了测试xgboost的加载数据,我只编写了一个简短的脚本,如下所示 import sys import numpy as np import scipy.sparse import pickle import xgboost as xgb

我对使用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中的脚本基本相同,只是目录不同

import sys
import numpy as np
import scipy.sparse
import pickle
import xgboost as xgb

# /home/mjoys/user_profile
dtrain = xgb.DMatrix('E:/user profile/test_xgboost/data/goods_items/textdata.txt')
print dtrain
令我惊讶的是,windows脚本的编译是成功的,但Linux脚本却出了问题。 你能不能看一下,告诉我Linux版本有什么问题? 非常感谢

windows结果:

D:\Anaconda2\python.exe "E:/user profile/test_xgboost/test1"
<xgboost.core.DMatrix object at 0x000000000664AC18>
143x0 matrix with 0 entries is loaded from E:/user 
profile/test_xgboost/data/goods_items/textdata.txt

Process finished with exit code 0

您可能希望显示src/data//strtonum.h的第141行(及其周围的行)包括哪些内容。此外,阅读可能是有益的。
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)