我们有两台运行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