我正在尝试在Google Colaboratory上使用GPU来运行XGBoost。这是我的笔记本:
import numpy as np
import os
import xgboost as xgb
train_X = np.random.rand(100,5)
train_Y = np.random.choice(2, 100)
test_X = np.random.rand(10,5)
test_Y = np.random.choice(2, 10)
xg_train = xgb.DMatrix(train_X, label=train_Y)
xg_test = xgb.DMatrix(test_X, label=test_Y)
param = {}
# use softmax multi-class classification
param['objective'] = 'multi:softmax'
# scale weight of positive examples
param['eta'] = 0.1
param['max_depth'] = 6
param['silent'] = 1
param['nthread'] = 4
param['num_class'] = 2
param['gpu_id'] = 0
param['max_bin'] = 16
param['tree_method'] = 'gpu_hist'
# watchlist allows us to monitor the evaluation result on all data in the list
watchlist = [(xg_train, 'train'), (xg_test, 'test')]
num_round = 5
bst = xgb.train(param, xg_train, num_round, watchlist)
当我运行最后一行时:
bst = xgb.train(param, xg_train, num_round, watchlist)
我看到了"Runtime died, Automatically restarting"的提示。
有什么方法可以进行故障排除吗?