Check failed: offset.back() == value.size() || value.size() == 0

Hi Folks,

I started running xgboost on a new set of libsvm formatted data and am hitting a bit of an esoteric error. When I run the following in my python shell:

import xgboost as xgb
dtrain = xgb.DMatrix(<path_to_my_file>)

I get a long spout of error text, with this key error line:

xgboost.core.XGBoostError: [22:36:24] …/src/data/ Encountered parser error: [22:36:24] …/dmlc-core/src/data/./row_block.h:177: Check failed: offset.back() == value.size() || value.size() == 0:

This issue occurs with my data set even if the data is only 1 input line long. I saw an old post (~7 years old) which seemed to imply this was due to invalid data points, but my data is pretty inoccuous and doesn’t contain any NANs, Nones, or infinities. Any idea what this error is implying?

Resolved the issue - turns out my data had some NaNs in it which caused the errors, and I had improperly performed checks for NaNs previously. I think the error with single line files was user error as well.