java.lang.ClassCastException: hex.deeplearning.DeepLearningModel cannot be cast to hex.GridSearch

JIRA | Parag Sanghavi | 2 years ago
tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  1. 0

    While trying to run the following R code on nunes release get the following error java.lang.ClassCastException: hex.deeplearning.DeepLearningModel cannot be cast to hex.GridSearch at hex.GridSearch$GridSearchProgress.serve(GridSearch.java:74) at water.api.Request.serveGrid(Request.java:165) at water.Request2.superServeGrid(Request2.java:490) at water.Request2.serveGrid(Request2.java:411) at water.api.Request.serve(Request.java:142) at water.api.RequestServer.serve(RequestServer.java:518) at water.NanoHTTPD$HTTPSession.run(NanoHTTPD.java:425) at java.lang.Thread.run(Thread.java:745) R script : # 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, install and initialize the H2O package for R. install.packages("h2o", repos=(c("http://h2o-release.s3.amazonaws.com/h2o/rel-nunes/2/R", getOption("repos")))) library(h2o) h = h2o.init() pathToFile = "/Users/paragsanghavi/Documents/h2o/smalldata/airlines/AirlinesTrain.csv.zip" data.hex = h2o.importFile(h, pathToFile) ## Summary stats, columns to ignore, quantiles and histograms summary(data.hex) # Constructing test and train sets by sampling data.split = h2o.splitFrame(data = data.hex,ratios = 0.85) data.train = data.split[[1]] data.test = data.split[[2]] # Set predictor and response variables # Print the header of the dataset myY = "IsDepDelayed" myX = c("Origin", "Dest", "fDayofMonth", "fYear", "UniqueCarrier", "fDayOfWeek", "fMonth", "DepTime", "ArrTime", "Distance") ## Deep Learning epoch = 10 data.dl = h2o.deeplearning(y = "IsDepDelayed", x = myX, data = data.train, classification=TRUE, hidden=c(1000), hidden_dropout_ratios= c(0.5), epochs = 1) Apparently , specifying c(0.5) in the hidden dropout ratio causes this problem

    JIRA | 2 years ago | Parag Sanghavi
    java.lang.ClassCastException: hex.deeplearning.DeepLearningModel cannot be cast to hex.GridSearch
  2. 0

    While trying to run the following R code on nunes release get the following error java.lang.ClassCastException: hex.deeplearning.DeepLearningModel cannot be cast to hex.GridSearch at hex.GridSearch$GridSearchProgress.serve(GridSearch.java:74) at water.api.Request.serveGrid(Request.java:165) at water.Request2.superServeGrid(Request2.java:490) at water.Request2.serveGrid(Request2.java:411) at water.api.Request.serve(Request.java:142) at water.api.RequestServer.serve(RequestServer.java:518) at water.NanoHTTPD$HTTPSession.run(NanoHTTPD.java:425) at java.lang.Thread.run(Thread.java:745) R script : # 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, install and initialize the H2O package for R. install.packages("h2o", repos=(c("http://h2o-release.s3.amazonaws.com/h2o/rel-nunes/2/R", getOption("repos")))) library(h2o) h = h2o.init() pathToFile = "/Users/paragsanghavi/Documents/h2o/smalldata/airlines/AirlinesTrain.csv.zip" data.hex = h2o.importFile(h, pathToFile) ## Summary stats, columns to ignore, quantiles and histograms summary(data.hex) # Constructing test and train sets by sampling data.split = h2o.splitFrame(data = data.hex,ratios = 0.85) data.train = data.split[[1]] data.test = data.split[[2]] # Set predictor and response variables # Print the header of the dataset myY = "IsDepDelayed" myX = c("Origin", "Dest", "fDayofMonth", "fYear", "UniqueCarrier", "fDayOfWeek", "fMonth", "DepTime", "ArrTime", "Distance") ## Deep Learning epoch = 10 data.dl = h2o.deeplearning(y = "IsDepDelayed", x = myX, data = data.train, classification=TRUE, hidden=c(1000), hidden_dropout_ratios= c(0.5), epochs = 1) Apparently , specifying c(0.5) in the hidden dropout ratio causes this problem

    JIRA | 2 years ago | Parag Sanghavi
    java.lang.ClassCastException: hex.deeplearning.DeepLearningModel cannot be cast to hex.GridSearch

    Root Cause Analysis

    1. java.lang.ClassCastException

      hex.deeplearning.DeepLearningModel cannot be cast to hex.GridSearch

      at hex.GridSearch$GridSearchProgress.serve()
    2. hex
      GridSearch$GridSearchProgress.serve
      1. hex.GridSearch$GridSearchProgress.serve(GridSearch.java:74)
      1 frame
    3. water.api
      Request.serveGrid
      1. water.api.Request.serveGrid(Request.java:165)
      1 frame
    4. water
      Request2.serveGrid
      1. water.Request2.superServeGrid(Request2.java:490)
      2. water.Request2.serveGrid(Request2.java:411)
      2 frames
    5. water.api
      RequestServer.serve
      1. water.api.Request.serve(Request.java:142)
      2. water.api.RequestServer.serve(RequestServer.java:518)
      2 frames
    6. water
      NanoHTTPD$HTTPSession.run
      1. water.NanoHTTPD$HTTPSession.run(NanoHTTPD.java:425)
      1 frame
    7. Java RT
      Thread.run
      1. java.lang.Thread.run(Thread.java:745)
      1 frame