Thai
Thai

Reputation: 513

biomod2 Warning message: running command 'java' had status 1

I'm trying to run MaxEnt in biomod2 but I keep getting a java error... This error seems to be related to a certain "status 1" that I can't understand.

This is my workflow:

#  Defining MAXENT Mododelling options
myBiomodOption <- BIOMOD_ModelingOptions(
  MAXENT.Phillips = list( path_to_maxent.jar = "C:/Users/thai/Documents/ORCHIDACEAE/Ecologicos/w2/biomod_1",
                 maximumiterations = 5000,
                 memory_allocated = 1024,
                 visible = FALSE,
                 linear = TRUE, 
                 quadratic = TRUE,
                 product = TRUE,
                 threshold = FALSE,
                 hinge = TRUE,
                 lq2lqptthreshold = 80,
                 l2lqthreshold = 10,
                 hingethreshold = 15,
                 beta_threshold = -1,
                 beta_categorical = -1,
                 beta_lqp = -1,
                 beta_hinge = -1,
                 defaultprevalence = 0.5))

This runs with no problems. Then, I run a code for computing the models:

#  Computing the models
myBiomodModelOut <- BIOMOD_Modeling(
  myBiomodData,
  models = c('MAXENT.Phillips'),  #'SRE','RF',
  models.options = myBiomodOption,
  NbRunEval=1,
  DataSplit=80,
  Yweights=NULL,
  VarImport=3,
  models.eval.meth = c('TSS','ROC'),
  SaveObj = TRUE,
  rescal.all.models = TRUE)

I get the running log up to the end. But then, the follownng message comes, in red:

Warning message: running command 'java' had status 1

The model appears to run despite this "status 1" error. When I evaluate the model, there is indeed an evaluation:

> get_evaluations(myBiomodModelOut)
, , MAXENT.Phillips, RUN1, AllData

    Testing.data Cutoff Sensitivity Specificity
TSS        0.982  939.0         100      98.202
ROC        0.988  946.5         100      98.494

, , MAXENT.Phillips, Full, AllData

    Testing.data Cutoff Sensitivity Specificity
TSS        0.774  687.0      83.333      94.035
ROC        0.926  689.5      83.333      94.085

Well, this is a model evaluation, so a model was made, right? But when I try to project, I get:

 #  Project our models over studied area
myBiomomodProj <- BIOMOD_Projection(modeling.output = myBiomodModelOut,
                                new.env = myExpl,
                                proj.name = 'current',
                                selected.models = 'all',
                                binary.meth = 'TSS',
                                compress = 'xz',
                                clamping.mask = F,
                                output.format = '.grd'
                                )

*** in setMethod('BinaryTransformation', signature(data='RasterLayer')
*** in setMethod('BinaryTransformation', signature(data='RasterLayer')
    > Projecting Anguloa.virginalis_AllData_RUN1_MAXENT.Phillips ...
Error in .local(.Object, ...) : 

In addition: Warning message:
running command 'java -mx1024m -cp "C:/Users/thai/Documents/ORCHIDACEAE/Ecologicos/w2/biomod_1/maxent.jar" density.Project "Anguloa.virginalis/models/1506620550/Anguloa.virginalis_AllData_RUN1_MAXENT.Phillips_outputs/Anguloa.virginalis_AllData_RUN1.lambdas" "Anguloa.virginalis/./m_46332684/part1" "Anguloa.virginalis/./m_46332684/part1/projMaxent.asc"  doclamp=false visible=false autorun nowarnings notooltips' had status 1 
Error in .rasterObjectFromFile(x, band = band, objecttype = "RasterLayer",  : 
  Cannot create a RasterLayer object from this file. (file does not exist)

You see? that "had status 1" part makes me believe that there is a problem being carried out since the model

I Did a lot of research and found out that some people managed maxent to work with biomod2 by moving maxent.ar to a folder with no spaces in the folder name... But this is not my case. Also, some people got it by chanfing the memory allocation... I also tryied several different memory amounts, and I just get different errors, but I still cant't get projections. Any tips?

Upvotes: 0

Views: 892

Answers (1)

Damien Georges
Damien Georges

Reputation: 126

My guess is that is due to a memory issue. I suspect you are working with high resolution environmental data on (quite) large area.

One thing to try should be:

  1. split the environmental data into smaller pieces/area
  2. make the projections on each area independently
  3. stick projections back together

Upvotes: 1

Related Questions