-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Blocking] python kernel failed when call Booster().predict #4056
Comments
@zzd1992 Let me look into this. |
@zzd1992 If you run the training process via Maybe a better error handling in c++ is needed. |
@trivialfis Thanks. |
@zzd1992 The label is only needed in training: dtrain = xgb.DMatrix(train_data, label=labels)
bst = xgb.train(params, dtrain) on prediction labels are not needed: dtest = xgb.DMatrix(testing_data)
bst.predict(dtest) The error you encountered is due to the fact that with empty labels in |
@trivialfis After running d = xgb.DMatrix(np.random.rand(1000, 5), np.random.rand(1000))
tree = xgb.Booster({'max_depth': 3, 'eta': 0.1, 'base_score': 0.0})
tree.boost(d, np.random.rand(1000), np.ones(1000))
print(tree.get_dump()[0])
print('start...')
preds = tree.predict(d)
print('end...') Then
|
I never tried this before. I don't think |
Sometimes, the python kernel will be failed when I call Booster().predict method.
Here is an example:
Then
However, when I modify the following line
into
Then every thing is ok.
How to fix this problem?
The text was updated successfully, but these errors were encountered: