Skip to content

Instantly share code, notes, and snippets.

@cxz

cxz/output.txt Secret

Created September 11, 2019 16:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cxz/b9c43be28ff2ce5a5b615b566dd8c647 to your computer and use it in GitHub Desktop.
Save cxz/b9c43be28ff2ce5a5b615b566dd8c647 to your computer and use it in GitHub Desktop.
Xgboost crash
$ 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
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