Fiji crashing with TrainableSegmentation

I am running Fiji on a new AMD ryzen 2600 system.
JAVA seems to be built into the system and i did not need to install JRE to run fiji (i might be wrong).
While trying to run my model to classify my fluorescent microscopy image, the app crashes and fiji exits.
model runs fine on my Intel system.
Installing JRE does not resolve the issue.

Error code i get from the log:

# A fatal error has been detected by the Java Runtime Environment:
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x000000005646e02d, pid=5312, tid=0x0000000000003c20
# JRE version: Java(TM) SE Runtime Environment (8.0_172-b11) (build 1.8.0_172-b11)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.172-b11 mixed mode windows-amd64 compressed oops)
# Problematic frame:
# V  [jvm.dll+0x2e02d]
# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
# If you would like to submit a bug report, please visit:

Any help would be appreciated :slight_smile:

@sinnersage Looks like a bug in Java. The easiest next step is probably to try running Fiji with different versions of Java. Be sure to check the Java version being used with each attempt you make.

My advice would be to try the following two versions of Java:

Try Java 8 first, and if it still crashes, try Java 11. Note that with Java 11, some exceptions upon startup of Fiji are expected:

  1. Multi-line warning beginning with WARNING: An illegal reflective access operation has occurred.
  2. An error beginning with [ERROR] Exception during event handling: and then a stack trace starting with java.lang.NoSuchMethodError: java.awt.MenuBar.getPeer()Ljava/awt/peer/MenuComponentPeer; (tracked at fiji/fiji#211).
  3. [ERROR]: Cannot locate JRE jar in /Library/Java/JavaVirtualMachines/jdk-11.0.1.jdk/Contents/Home.
  4. An error beginning with [ERROR] Cannot create plugin: class='org.scijava.ui.swing.script.languagesupport.JavaLanguageSupportPlugin' followed by a stack trace starting with java.lang.IllegalArgumentException: info cannot be null.

These errors are all safe to ignore for the purposes of everyday Fiji usage.

1 Like

Thank you for the help!
I have resolved it by downloading a new instance of Fiji.
I had errors running the Fiji app that was in my cloud folder. This is possibly due to pathing errors and differences in the Java version used between my 2 systems.

side note: Encountered import error trainableSegmentation module does not exists while running my script. Problem resolved by running trainable Weka Segmentation plugin first before running my script.

1 Like

How do you import? And using which script language? Please share a minimal example script. Running the plugin manually should not be required to access the Weka Segmentation classes via scripting.

import os
import trainableSegmentation as weka
import trainableSegmentation.utils.Utils as Utils
from ij import IJ, ImagePlus
from ij.process import ImageConverter

My script was written in Jython. Error encountered in line 2.

1 Like

trainableSegmentation is a package, not a class. So you can write e.g.:

from trainableSegmentation import *


from trainableSegmentation import WekaSegmentation as weka


import trainableSegmentation.WekaSegmentation as weka

But I don’t think Jython allows to import an entire package without a wildcard. Does it?

1 Like

This seems to be a Jython-specific thing. Once you started a plugin from the UI, you can import the package without the wildcards (?!). I’ve seen this reported now for Trainable Weka Segmentation (by @sinnersage here) as well as for @Christian_Tischer’s fiji-plugin-illuminationCorrection in a private conversation with him and @jonasmac (I don’t think you opened a topic about this here in the end, did you?).

Can someone confirm? And maybe even explain? :slight_smile:

1 Like

Thank you @ctrueden for the advice. It make sense that i couldn’t import a package.
Imported WekaSegmentation and it works fine now.

Yes i can confirm that you can import the package after starting the plugin. I suppose starting the plugin loads the package, allowing Jython to find the package in the current FIJI instance.