Search code examples
rh2o

Is this a Potential code error or machine set up error? Not sure


I am working through section 19.2.3 of HOML/autoencoders.html and found an error message pop up.

In section: 19.2.3 Visualizing the reconstruction, I found an error associated with the line:

# Predict reconstructed pixel values  
best_model_id <- grid_perf@model_ids[[1]]

after this line I get:

Error: object 'grid_perf' not found

Up to this point, I have followed the code from the Autoencoder section, should I look at my setup or is this a change in H2O.ai and code?

HTH


Solution

  • Based on the error, there is no object grid_perf to call. It should be defined before that line runs.

    From the document you are following, in section 19.2.2, it defines ae_grid:

    ae_grid <- h2o.grid(
      algorithm = 'deeplearning',
      x = seq_along(features),
      training_frame = features,
      grid_id = 'autoencoder_grid',
      autoencoder = TRUE,
      activation = 'Tanh',
      hyper_params = hyper_grid,
      sparse = TRUE,
      ignore_const_cols = FALSE,
      seed = 123
    )
    

    Did you try defining grid_perf?

    Then it calls it in section 19.2.3 best_model_id <- ae_grid@model_ids[[1]] which is what it looks like you are trying to replicate.