问题描述
基本上,我在本地计算机上训练了caret
ML模型(XGBoost
),并且对它进行并行化没有问题。
这是我在本地R Studio
中运行的代码:
train.control <- trainControl(method = "repeatedcv",number = 10,repeats = 3,search = "grid")
tune.grid <- expand.grid(eta = c(0.05,0.075,0.1),nrounds = c(50,75,100),max_depth = 9:11,min_child_weight = c(2.0,2.25,2.5),colsample_bytree = c(0.3,0.4,0.5),gamma = 0,subsample = 1)
cl <- sNow::makeCluster(4,type = "SOCK")
doSNow::registerDoSNow(cl)
xgboost.train.500.solver <- train(target ~ .,data = data,method = "xgbTree",preProcess = c("scale","center"),tuneGrid = tune.grid,trControl = train.control)
stopCluster(cl)
正如我所说的那样,它可以并行运行并且工作正常(精简版的时间消耗约为10分钟)
现在,我在Ubuntu
上设置了一个16核Google Cloud Platform
服务器,并在那里安装了R + R Studio服务器。当我运行相同的脚本(将内核设置为16 ofc)时,模型将不会终止(尝试> 10小时)。这里发生了什么?我已经检查过htop
,R进程使用了全部16个内核。因此,工人的后端注册就可以了。
谢谢。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)