Adaptive Thresholding / Object Discrimination crashes from GPT

Hi Team,

there are multiple steps of gpt calls to perform ship detection in my script. After the calibration step, I have a graph file specifying adaptive thresholding + object detection. When the following line is included…

<estimateBackground>true</estimateBackground>

… the procedure crashes half-way with the attached message at the bottom. If I take out this line, it computes yet the speed is abysmal (slower by factor 20).

Additional Info: the workflow returns without errors at my local laptop with 8 GB RAM running Fedora 31. The problems start when transferring this workflow into a cloud-based VM and calling it from a docker container. For this, I use a stable Debian and setup Snap in a standard way. Like mentioned earlier, the preceding steps all work well, the Snap setup appears fully functional.

What have I done until now?

  • Played tons with the Xmx, Xms, Heap etc. parameters and used VM’s with excessive amounts of RAM. Doesn’t appear to be the culprit.
  • As mentioned; took out the background line
  • Did it with and without updating Snap in advance.

What else could there be?

Now the Crash message:

Executing processing graph
java.lang.NullPointerException
at org.esa.s1tbx.io.ceos.alos2.Alos2GeoTiffProductReaderPlugIn.checkFileName(Alos2GeoTiffProductReaderPlugIn.java:124)
at org.esa.s1tbx.io.ceos.alos2.Alos2GeoTiffProductReaderPlugIn.getDecodeQualification(Alos2GeoTiffProductReaderPlugIn.java:108)
at org.esa.snap.core.dataio.ProductIO.getProductReaderForInput(ProductIO.java:263)
at org.esa.snap.core.gpf.common.ReadOp.initialize(ReadOp.java:112)
at org.esa.snap.core.gpf.internal.OperatorContext.initializeOperator(OperatorContext.java:486)
at org.esa.snap.core.gpf.internal.OperatorContext.getTargetProduct(OperatorContext.java:273)
at org.esa.snap.core.gpf.Operator.getTargetProduct(Operator.java:387)
at org.esa.snap.core.gpf.graph.NodeContext.initTargetProduct(NodeContext.java:77)
at org.esa.snap.core.gpf.graph.GraphContext.initNodeContext(GraphContext.java:195)
at org.esa.snap.core.gpf.graph.GraphContext.initNodeContext(GraphContext.java:178)
at org.esa.snap.core.gpf.graph.GraphContext.initNodeContext(GraphContext.java:178)
at org.esa.snap.core.gpf.graph.GraphContext.initNodeContext(GraphContext.java:178)
at org.esa.snap.core.gpf.graph.GraphContext.initOutput(GraphContext.java:162)
at org.esa.snap.core.gpf.graph.GraphContext.(GraphContext.java:91)
at org.esa.snap.core.gpf.graph.GraphContext.(GraphContext.java:64)
at org.esa.snap.core.gpf.graph.GraphProcessor.executeGraph(GraphProcessor.java:128)
at org.esa.snap.core.gpf.main.DefaultCommandLineContext.executeGraph(DefaultCommandLineContext.java:86)
at org.esa.snap.core.gpf.main.CommandLineTool.executeGraph(CommandLineTool.java:534)
at org.esa.snap.core.gpf.main.CommandLineTool.runGraph(CommandLineTool.java:388)
at org.esa.snap.core.gpf.main.CommandLineTool.runGraphOrOperator(CommandLineTool.java:287)
at org.esa.snap.core.gpf.main.CommandLineTool.run(CommandLineTool.java:188)
at org.esa.snap.core.gpf.main.CommandLineTool.run(CommandLineTool.java:121)
at org.esa.snap.core.gpf.main.GPT.run(GPT.java:54)
at org.esa.snap.core.gpf.main.GPT.main(GPT.java:34)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.esa.snap.runtime.Launcher.lambda$run$0(Launcher.java:55)
at org.esa.snap.runtime.Engine.runClientCode(Engine.java:189)
at org.esa.snap.runtime.Launcher.run(Launcher.java:51)
at org.esa.snap.runtime.Launcher.main(Launcher.java:31)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.exe4j.runtime.LauncherEngine.launch(LauncherEngine.java:65)
at com.install4j.runtime.launcher.UnixLauncher.main(UnixLauncher.java:57)
SEVERE: org.esa.snap.core.dataio.ProductIO: Error attempting to read S1_subset_mask_cal.dim with plugin reader org.csa.rstb.io.rcm.RCMProductReaderPlugIn@1510b9a2: null
INFO: org.hsqldb.persist.Logger: dataFileCache open start
…10%…20%…30%…40%…50%.java.lang.StackOverflowError
90% done.
org.esa.snap.core.gpf.OperatorException: java.lang.StackOverflowError
at org.esa.snap.core.gpf.graph.GraphProcessor$GPFImagingListener.errorOccurred(GraphProcessor.java:363)
at com.sun.media.jai.util.SunTileScheduler.sendExceptionToListener(SunTileScheduler.java:1646)
at com.sun.media.jai.util.SunTileScheduler.scheduleTile(SunTileScheduler.java:921)
at javax.media.jai.OpImage.getTile(OpImage.java:1129)
at javax.media.jai.PlanarImage.getData(PlanarImage.java:2085)
at com.bc.ceres.glevel.MultiLevelImage.getData(MultiLevelImage.java:64)
at org.esa.snap.core.gpf.internal.OperatorContext.getSourceTile(OperatorContext.java:407)
at org.esa.snap.core.gpf.internal.OperatorContext.getSourceTile(OperatorContext.java:393)
at org.esa.snap.core.gpf.internal.OperatorImage.computeRect(OperatorImage.java:73)
at javax.media.jai.SourcelessOpImage.computeTile(SourcelessOpImage.java:137)
at com.sun.media.jai.util.SunTileScheduler.scheduleTile(SunTileScheduler.java:904)
at javax.media.jai.OpImage.getTile(OpImage.java:1129)
at com.sun.media.jai.util.RequestJob.compute(SunTileScheduler.java:247)
at com.sun.media.jai.util.WorkerThread.run(SunTileScheduler.java:468)
Caused by: org.esa.snap.core.gpf.OperatorException: java.lang.StackOverflowError
at org.esa.snap.engine_utilities.gpf.OperatorUtils.catchOperatorException(OperatorUtils.java:415)
at org.esa.s1tbx.fex.gpf.oceantools.ObjectDiscriminationOp.computeTile(ObjectDiscriminationOp.java:265)
at org.esa.snap.core.gpf.internal.OperatorImage.computeRect(OperatorImage.java:80)
at javax.media.jai.SourcelessOpImage.computeTile(SourcelessOpImage.java:137)
at com.sun.media.jai.util.SunTileScheduler.scheduleTile(SunTileScheduler.java:904)
… 11 more
Caused by: java.lang.StackOverflowError
at org.esa.s1tbx.fex.gpf.oceantools.ObjectDiscriminationOp.clustering(ObjectDiscriminationOp.java:288)
at org.esa.s1tbx.fex.gpf.oceantools.ObjectDiscriminationOp.clustering(ObjectDiscriminationOp.java:299)
at org.esa.s1tbx.fex.gpf.oceantools.ObjectDiscriminationOp.clustering(ObjectDiscriminationOp.java:299)


at org.esa.s1tbx.fex.gpf.oceantools.ObjectDiscriminationOp.clustering(ObjectDiscriminationOp.java:299)
at org.esa.s1tbx.fex.gpf.oceantools.ObjectDiscriminationOp.clustering(ObjectDiscriminationOp.java:299)
at org.esa.s1tbx.fex.gpf.oceantools.ObjectDiscriminationOp.clustering(ObjectDiscriminationOp.java:299)
at org.esa.s1tbx.fex.gpf.oceantools.ObjectDiscriminationOp.clustering(ObjectDiscriminationOp.java:299)
at org.esa.s1tbx.fex.gpf.oceantools.ObjectDiscriminationOp.clustering(ObjectDiscriminationOp.java:299)

Error: java.lang.StackOverflowError

EDIT:

When I split the two steps of thresholding and detection into two separate .xml flows; the same error happens at the second part of the process (the object detection), while the first .xml works.