H20.deeplearning in R error:找不到参数:key

时间:2017-02-26 15:33:30

标签: r deep-learning h2o

我在RStudio中遇到h2o(deeplearning)问题。 这是我第一次使用h2o,每当我尝试使用h2o.deeplearning()时,prozess会在达到100%时冻结。当我想在循环中构建多个模型时(如下所示),对于第一个模型,它达到100%然后冻结。 我附上我的代码和下面的错误消息:

 <<>>= remove/install packages
# The following two commands remove any previously installed H2O packages     for R.
if ("package:h2o" %in% search()) { detach("package:h2o", unload=TRUE) }
if ("h2o" %in% rownames(installed.packages())) { remove.packages("h2o") }

# Next, we download packages that H2O depends on.
pkgs <- c("methods","statmod","stats","graphics","RCurl","jsonlite","tools","utils")
for (pkg in pkgs) {
if (! (pkg %in% rownames(installed.packages()))) { install.packages(pkg) }
}

# Now we download, install and initialize the H2O package for R.
install.packages("h2o", type="source", repos=(c("http://h2o-release.s3.amazonaws.com/h2o/rel-tverberg/5/R")))
@
<<>>==

library(h2o)
localH2O=h2o.init(nthreads = -1)
@

I get this result after init(nthreads=-1)

<<>>= #load data
training <- read.csv("training.csv", row.names = "ID", colClasses = c(Affection = "factor"))
testing <- read.csv("testing.csv", row.names = "ID", colClasses = c(DRB1_1 = "factor"))
training_h2o <- as.h2o(training)
testing_h2o <- as.h2o(testing)
@

然后我尝试构建类似于此处解释的多个模型:githup explanation

<<>>=#tune Parameter

#compute multiple models
models <- c()
for (i in 1:5){
rand_activation <- c("Tanh", "Rectifier")[sample(1:2,1)]
rand_epochs <- sample(c(10, 15),1)
rand_hidden <- c(sample(100:500,2))
rand_l1 <- runif(1, 0, 1e-3)
rand_l2 <- runif(1, 0, 1e-3)
rand_input_dropout <- runif(1, 0, 0.5)
dl.model <- h2o.deeplearning(x = 2:3979, y = 1, training_frame =  training_h2o, nfolds = 10, keep_cross_validation_predictions = TRUE,   variable_importances = TRUE, adaptive_rate = TRUE,
 activation = rand_activation, hidden = rand_hidden, l1=rand_l1, l2 =     rand_l2, epochs = rand_epochs, input_dropout_ratio = rand_input_dropout)  
models <- c(models, dl.model)
}

但如前所述,这总是冻结,当我取消它时,我得到以下错误(缩短):

ERROR: Unexpected HTTP Status code: 404 Not Found (url =   http://localhost:54321/3/Models/DeepLearning_model_R_1488120350711_1)

water.exceptions.H2OKeyNotFoundArgumentException
[1] "water.exceptions.H2OKeyNotFoundArgumentException: Object    'DeepLearning_model_R_1488120350711_1' not found for argument: key"
 [2] "    water.api.ModelsHandler.getFromDKV(ModelsHandler.java:110)"                                                             
 [3] "    water.api.ModelsHandler.fetch(ModelsHandler.java:129)"                                                                  
 [4] "    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)"                                                            
 [5] "    sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)"                                                            

[35] "    org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)"                                       
[36] "        org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)"                                        
[37] "    java.lang.Thread.run(Unknown Source)"                                                                                   

Error in .h2o.doSafeREST(h2oRestApiVersion = h2oRestApiVersion, urlSuffix =    page,  : 


ERROR MESSAGE:

Object 'DeepLearning_model_R_1488120350711_1' not found for argument: key

有人可以帮我吗?我之前从未使用过h2o,也不确定我是否正确使用了命令,但试图接近h2o.pdf。 我也无法打开错误中给出的网址。

感谢您的帮助!

0 个答案:

没有答案