Can't produce model with Maxent

171 views
Skip to first unread message

Yo Pinto

unread,
Apr 17, 2020, 5:17:21 PM4/17/20
to Wallace Ecological Modeling App
Hello,I'm trying to produce a species model distribution of Tamandua tetradactyla with 300 localities and following the step-by-step of the Wallace vignette tutorial (https://wallaceecomod.github.io/vignettes/wallace_vignette.html). For some reazon when I run de model in Maxent using the feature clases L, LQ and H just as the tutorial says, the program turns all grey and stops working just when it is running the H1, as you can see in the picture. 


Captura.PNG

Is the first time it happens to me and I already had made other models with Wallace with out any problem. Does somebody knows what to do? 

Gonzalo Pinilla-Buitrago

unread,
Apr 18, 2020, 10:28:11 AM4/18/20
to Wallace Ecological Modeling App
Hi Yo Pinto,

I think that your issue is related to a bug on the maxnet package (this always happens randomly with the hinge class). Although, I'm not completely sure without seeing the error msg that you got in your r console. The workaround of this problem is using the maxent.jar option instead of maxnet. Keep in mind that you need to place the maxent.jar file in a specific place in your machine. This link is a good resource if you need help (https://github.com/wallaceEcoMod/wallace/tree/master#how-to-run-maxent-with-maxentjar).

Please let me know if the solution works for you.

Best,
Gonzalo 

Sebastià JR

unread,
May 2, 2020, 9:07:33 AM5/2/20
to Wallace Ecological Modeling App
Hello, 

I have the same problem, when running the model, after H1 it turns grey and this message error appears in R:

Warning: from glmnet Fortran code (error code -186); Convergence for 186th lambda value not reached after maxit=100000 iterations; solutions for larger lambdas returned
Warning: Error in intI: index larger than maximal 185
  104: stop
  103: intI
  102: subCsp_cols
  101: [
   96: [
   94: maxnet::maxnet
   93: modelTune.maxnet
   92: tuning
   91: ENMeval::ENMevaluate
   90: <reactive> [modules/mod_c6_maxent.R#94]
   74: mod.maxent
   73: observeEventHandler [/Library/Frameworks/R.framework/Versions/3.6/Resources/library/wallace/shiny/server.R#519]
    2: shiny::runApp
    1: run_wallace

I tried to reload the Wallace package but it keeps happening, 

Thank you, 

Sebastià

Gonzalo Pinilla-Buitrago

unread,
May 2, 2020, 9:12:38 AM5/2/20
to Wallace Ecological Modeling App
> Is the first time it happens to me and I already had made other models with Wallace with out any problem. Does somebody knows what to do? 

Hi Sebastià,

Did you try the workaround of using the maxent.jar option? Right now, it is the only way to get your models when maxnet has problems with the hinge class.

Please, let me know if this works for you.

Best,
Gonzalo

Sebastià JR

unread,
May 3, 2020, 10:05:31 AM5/3/20
to Wallace Ecological Modeling App
Hello,

When running the maxent.jar option this error appears in R:

> library(wallace)
> run_wallace()

Loading required package: rJava
Warning in fun(libname, pkgname) :
  Cannot find JVM library '/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/server/libjvm.dylib'
Install Java and/or check JAVA_HOME (if in doubt, do NOT set it, it will be detected)
Error: package or namespace load failed for ‘rJava’:
 .onLoad failed in loadNamespace() for 'rJava', details:
  call: fun(libname, pkgname)
  error: JVM could not be found

I have the rJava package installed, but i do not know how to fix the problem. 

Best, 
Sebastià 

Gonzalo Pinilla-Buitrago

unread,
May 4, 2020, 10:54:02 AM5/4/20
to Wallace Ecological Modeling App
Hi Sebastià,

Unfortunately, you got a common and annoying problem for running maxent.jar on R. I think it is a problem between the Java version and the Mac OS version that you are using (although it looks like there are some issues of loading rJava on R v4). Which versions of these are you using (R, Java, MacOS)?


Best,
Gonzalo 

Sebastià JR

unread,
May 4, 2020, 12:51:29 PM5/4/20
to Wallace Ecological Modeling App
Okey, I will take a look at the link, the versions I am using are: MacOs Mojave 10.14.6, R 4.0.0 GUI 1.71 and Java 8. May the problem disappear if I update to MacOs Catalina? i see the R 4.0 version is optimized for that MacOs version.

Thank you, 
Sebastià

Gonzalo Pinilla-Buitrago

unread,
May 11, 2020, 5:39:16 PM5/11/20
to Wallace Ecological Modeling App
Hi Sebastià,

Unfortunately, I can not help you too much with specific problems because I am not a mac user. The error that you got is similar to the report StackOverflow post, so maybe you just need to link your libjvm.dylib to /usr/local/lib.

Let me know if this works for you.

Best,
Gonzalo

Jamie M. Kass

unread,
May 13, 2020, 6:45:22 AM5/13/20
to Wallace Ecological Modeling App
As a Mac user, and frequent sufferer of rJava problems, I can tell you what works for me. Uninstall the current version of Java you have (check stackOverflow for the procedure). Download the latest Java version and JDK, making sure it matches your processor (32 or 64 bit). Reinstall rJava. It should load up now, and you should be able to use dismo::maxent().

Jamie

Sebastià JR

unread,
May 19, 2020, 8:11:02 AM5/19/20
to Wallace Ecological Modeling App
Hello, 

I think i finally fix that following your and other similar advises, but now another error appears... When trying to run Wallace with maxent.jar appears:

Warning: Error in rJava::.jnew: java.lang.ClassNotFoundException
  95: <Anonymous>

I am trying to find a solution... 

Thank you for your help even when it is not a "wallace problem" but mine i suppose.

Sebastià

Gonzalo Pinilla-Buitrago

unread,
May 20, 2020, 12:16:23 PM5/20/20
to Wallace Ecological Modeling App
Hi Sebastià,

Let us know if you are getting the same problem again. We will do our best to help you.

Thanks for using Wallace and for reporting this issue.

Best,
Gonzalo

Dimitris Poursanidis

unread,
May 22, 2020, 9:24:22 AM5/22/20
to Wallace Ecological Modeling App
What if downgrate R and use the previou one?
Have you try it?

Jamie M. Kass

unread,
Oct 17, 2020, 1:42:58 AM10/17/20
to Wallace Ecological Modeling App
I know it's been a long time since this post, but I'd like to emphasize that for those with Java problems, the other solution would be to just use maxnet instead, which does not rely on Java.

Jamie
Reply all
Reply to author
Forward
0 new messages