-
-
Save cxz/b9c43be28ff2ce5a5b615b566dd8c647 to your computer and use it in GitHub Desktop.
Xgboost crash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ python test.py | |
0.90 1.2.1 | |
terminate called after throwing an instance of 'thrust::system::system_error' | |
what(): parallel_for failed: out of memory |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from scipy.sparse import csr_matrix | |
import xgboost as xgb | |
SAMPLES = 1_000_000 | |
SPARSE_FEATURES = 300 #300_000 | |
NUM_CLASS = 2000 | |
param = { | |
'objective': 'multi:softmax', | |
'num_class': NUM_CLASS, | |
'verbosity': 3, | |
} | |
num_round = 1 | |
X = csr_matrix((SAMPLES, SPARSE_FEATURES), dtype=np.float32) | |
y = np.ones((SAMPLES, NUM_CLASS), dtype=np.uint8) | |
nrow_train = int(0.9*SAMPLES) | |
d_train = xgb.DMatrix(X, label=y) | |
bst = xgb.train(param, d_train, num_round) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment