0
votes

Having got the implementation of MOJO prediction working on local install, we migrated the code to Centos 7 and are now having issues with the code, despite the only real difference between local windows and centos being java versions. Code as follows. Error we get on Centos;

Error in system2(java, args, stdout = TRUE, stderr = TRUE) : error in running command

This is version info from both platforms;

VM – Centos 7 openjdk version "1.8.0_161" OpenJDK Runtime Environment (build 1.8.0_161-b14) OpenJDK 64-Bit Server VM (build 25.161-b14, mixed mode) H2O cluster version: 3.16.0.2 R Version:
R version 3.4.3 (2017-11-30) Local – Windows 7 64bit java version "1.8.0_151" Java(TM) SE Runtime Environment (build 1.8.0_151-b12) Java HotSpot(TM) 64-Bit Server VM (build 25.151-b12, mixed mode) H2O cluster version: 3.16.0.2 R Version: R version 3.4.1 (2017-06-30)

library(RJDBC)
library(dplyr)
library(h2o)
library(jsonlite)

# set up h2o
options(java.parameters = "- Xmx2400m")
Sys.unsetenv("http_proxy")
localh20=h2o.init(ip           = "localhost",
                  nthreads     = -1, # how many CPU cores to use
                  port         = 54321,
                  max_mem_size = "32g") # how much memory to use
h2o.removeAll() 

df<- data.frame(VAR1=1,VAR2=1,VAR3=1,VAR4=1,VAR5=1,VAR6=1,VAR7="'METAL'",VAR8 = "'LONDON & SE'" )
dfstr <- sapply(1:ncol(df), function(i) paste(paste0('\"', names(df)[i], '\"'), df[1,i], sep = ':'))
json <- paste0('{', paste0(dfstr, collapse = ','), '}')
dataPredict <- as.data.frame(h2o.predict_json(model = "D:\\GBM_model_0_CMP.zip", json = json, genmodelpath = "D:\\h2o-genmodel.jar", labels = TRUE))
dataPredict <-dataPredict[,c(3,4)]
names(dataPredict) <- c("Score", "Class")
1

1 Answers

0
votes
options(java.parameters = "- Xmx2400m")

It looks like there is an extra space between "- X". Remove it.