我们有 2 台运行 R 的服务器。
一台服务器有 2.15.2。这是程序运行良好。
我们在另一台服务器上安装了最新的 R - 版本 3.0.1。
在此服务器上,我们使用相同的代码收到以下错误
Error in checkForRemoteErrors(val) :
5 nodes produced errors; first error: incorrect number of dimensions
Calls: build.model ... clusterApply -> staticClusterApply -> checkForRemoteErrors
Execution halted
看起来 2.15.2 不使用雪,而 3.0.1 使用雪进行并行计算。
我该如何解决这个问题?
错误可能来自 Rscript。我们不确定。这是代码
model.building.main <- function(configFile, model.repository) {
source("read_QE_config.R")
param <- read.QE.config(configFile)
model.count <- 0
for (i in 1:nrow(param$models)) {
model.name <- param$models$model.name[i]
independent.variables <- param$independent.variables[param$independent.variables$model==model.name &
param$independent.variables$in.model,]
stage.number <- as.integer(param$models$stage.number[i])
stage.numbers <- as.integer(independent.variables$stage.number)
relevant.variables <- independent.variables[stage.numbers <= stage.number,]
if (!all(!relevant.variables$incomplete.data)) {
# model.file.name <- paste(model.repository, "/", model.name, "_", stage.number, "_existing.Rdata", sep="")
exec.command <- paste("Rscript script_model_building.R", configFile, model.name, stage.number, "existing", model.repository, sep=" ")
cat(paste(exec.command, "\n", sep=" "))
system(exec.command, wait=FALSE)
model.count <- model.count + 1
# model.file.name <- paste(model.repository, "/", model.name, "_", stage.number, "_new.Rdata", sep="")
exec.command <- paste("Rscript script_model_building.R", configFile, model.name, stage.number, "new", model.repository, sep=" ")
cat(paste(exec.command, "\n", sep=" "))
system(exec.command, wait=FALSE)
model.count <- model.count + 1
} else {
# model.file.name <- paste(model.repository, "/", model.name, "_", stage.number, "_existing.Rdata", sep="")
exec.command <- paste("Rscript script_model_building.R", configFile, model.name, stage.number, "existing", model.repository, sep=" ")
cat(paste(exec.command, "\n", sep=" "))
system(exec.command, wait=FALSE)
model.count <- model.count + 1
}
}
return(model.count)
}
错误出现在另一个文件的以下行中
gbm.model.standard <- gbm(Y ~ .,
distribution = param$distribution,
data = data.standard,
n.trees = gbm.training.ntrees,
interaction.depth = 3,
shrinkage = 0.001,
bag.fraction = 0.6,
verbose = param$gbm.detail,
cv.folds = cv.folds.standard)
我们在 R 2.15.2 中使用 gbm_1.6-3.2,在 R 3.0.1 中使用 gbm 2.1