CSBDeep TensorFlow issues

Hi all,

I have been using CSBDeep’s DenoiSeg package for image segmentation. Until now, it has been working without issue. Now, when I try to run a predict workflow I get the error: Could not load TensorFlow.

I believe the issue may be my recent update of FIJI, but I don’t remember if TensorFlow was updated specifically. In any event, I haven’t made any modifications to FIJI or the TensorFlow package aside from updates. As a matter of fact, when DenoiSeg was working I didn’t even have the TensorFlow update site checked.

How do I address this issue?

Here’s the full error description:

[ERROR] *** One or more readers is misbehaving. See the debug output for more information. e.g.:
loci.formats.in.APLReader@19ae61a1 -> java.lang.NullPointerException(‘null’) ***
[WARNING] Crash file exists: /home/labuser-ivz/fiji-linux64/Fiji.app/lib/linux64/.crashed
[WARNING] The JVM seems to have crashed when loading the TensorFlow JAR library: file:/home/labuser-ivz/fiji-linux64/Fiji.app/jars/libtensorflow-1.12.0.jar
[WARNING] Please run Edit > Options > TensorFlow and choose another version or delete the crash file to load the JAR library again.
io.scif.MissingLibraryException: Could not load TensorFlow. Check previous errors and warnings for details.
at net.imagej.modelzoo.consumer.model.tensorflow.TensorFlowModel.loadLibrary(TensorFlowModel.java:126)
at net.imagej.modelzoo.DefaultModelZooArchive.createModelInstance(DefaultModelZooArchive.java:104)
at net.imagej.modelzoo.consumer.DefaultModelZooPrediction.loadModel(DefaultModelZooPrediction.java:111)
at net.imagej.modelzoo.consumer.DefaultModelZooPrediction.run(DefaultModelZooPrediction.java:84)
at de.csbdresden.denoiseg.predict.DenoiSegPrediction.run(DenoiSegPrediction.java:92)
at net.imagej.modelzoo.consumer.commands.DefaultModelZooPredictionCommand.run(DefaultModelZooPredictionCommand.java:99)
at de.csbdresden.denoiseg.command.DenoiSegPredictCommand.run(DenoiSegPredictCommand.java:43)
at org.scijava.command.CommandModule.run(CommandModule.java:196)
at org.scijava.module.ModuleRunner.run(ModuleRunner.java:165)
at org.scijava.module.ModuleRunner.call(ModuleRunner.java:124)
at org.scijava.module.ModuleRunner.call(ModuleRunner.java:63)
at org.scijava.thread.DefaultThreadService.lambda$wrap$2(DefaultThreadService.java:225)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
[INFO] ModelZoo prediction exit (took 7651 milliseconds)
[ERROR] Module threw exception
java.lang.NullPointerException
at de.csbdresden.denoiseg.command.DenoiSegPredictCommand.run(DenoiSegPredictCommand.java:44)
at org.scijava.command.CommandModule.run(CommandModule.java:196)
at org.scijava.module.ModuleRunner.run(ModuleRunner.java:165)
at org.scijava.module.ModuleRunner.call(ModuleRunner.java:124)
at org.scijava.module.ModuleRunner.call(ModuleRunner.java:63)
at org.scijava.thread.DefaultThreadService.lambda$wrap$2(DefaultThreadService.java:225)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
[ERROR] Module threw exception
java.lang.ClassCastException: class jdk.internal.loader.ClassLoaders$AppClassLoader cannot be cast to class java.net.URLClassLoader (jdk.internal.loader.ClassLoaders$AppClassLoader and java.net.URLClassLoader are in module java.base of loader ‘bootstrap’)
at net.imagej.tensorflow.util.TensorFlowUtil.getTensorFlowJARVersion(TensorFlowUtil.java:79)
at net.imagej.tensorflow.util.TensorFlowUtil.versionFromClassPathJAR(TensorFlowUtil.java:94)
at net.imagej.tensorflow.ui.TensorFlowLibraryManagementCommand.getTensorFlowJARVersion(TensorFlowLibraryManagementCommand.java:112)
at net.imagej.tensorflow.ui.TensorFlowLibraryManagementCommand.initAvailableVersions(TensorFlowLibraryManagementCommand.java:98)
at net.imagej.tensorflow.ui.TensorFlowLibraryManagementCommand.run(TensorFlowLibraryManagementCommand.java:86)
at org.scijava.command.CommandModule.run(CommandModule.java:196)
at org.scijava.module.ModuleRunner.run(ModuleRunner.java:165)
at org.scijava.module.ModuleRunner.call(ModuleRunner.java:124)
at org.scijava.module.ModuleRunner.call(ModuleRunner.java:63)
at org.scijava.thread.DefaultThreadService.lambda$wrap$2(DefaultThreadService.java:225)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
[ERROR] Module threw exception
java.lang.ClassCastException: class jdk.internal.loader.ClassLoaders$AppClassLoader cannot be cast to class java.net.URLClassLoader (jdk.internal.loader.ClassLoaders$AppClassLoader and java.net.URLClassLoader are in module java.base of loader ‘bootstrap’)
at net.imagej.tensorflow.util.TensorFlowUtil.getTensorFlowJARVersion(TensorFlowUtil.java:79)
at net.imagej.tensorflow.util.TensorFlowUtil.versionFromClassPathJAR(TensorFlowUtil.java:94)
at net.imagej.tensorflow.ui.TensorFlowLibraryManagementCommand.getTensorFlowJARVersion(TensorFlowLibraryManagementCommand.java:112)
at net.imagej.tensorflow.ui.TensorFlowLibraryManagementCommand.initAvailableVersions(TensorFlowLibraryManagementCommand.java:98)
at net.imagej.tensorflow.ui.TensorFlowLibraryManagementCommand.run(TensorFlowLibraryManagementCommand.java:86)
at org.scijava.command.CommandModule.run(CommandModule.java:196)
at org.scijava.module.ModuleRunner.run(ModuleRunner.java:165)
at org.scijava.module.ModuleRunner.call(ModuleRunner.java:124)
at org.scijava.module.ModuleRunner.call(ModuleRunner.java:63)
at org.scijava.thread.DefaultThreadService.lambda$wrap$2(DefaultThreadService.java:225)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
[ERROR] Module threw exception
java.lang.ClassCastException: class jdk.internal.loader.ClassLoaders$AppClassLoader cannot be cast to class java.net.URLClassLoader (jdk.internal.loader.ClassLoaders$AppClassLoader and java.net.URLClassLoader are in module java.base of loader ‘bootstrap’)
at net.imagej.tensorflow.util.TensorFlowUtil.getTensorFlowJARVersion(TensorFlowUtil.java:79)
at net.imagej.tensorflow.util.TensorFlowUtil.versionFromClassPathJAR(TensorFlowUtil.java:94)
at net.imagej.tensorflow.ui.TensorFlowLibraryManagementCommand.getTensorFlowJARVersion(TensorFlowLibraryManagementCommand.java:112)
at net.imagej.tensorflow.ui.TensorFlowLibraryManagementCommand.initAvailableVersions(TensorFlowLibraryManagementCommand.java:98)
at net.imagej.tensorflow.ui.TensorFlowLibraryManagementCommand.run(TensorFlowLibraryManagementCommand.java:86)
at org.scijava.command.CommandModule.run(CommandModule.java:196)
at org.scijava.module.ModuleRunner.run(ModuleRunner.java:165)
at org.scijava.module.ModuleRunner.call(ModuleRunner.java:124)
at org.scijava.module.ModuleRunner.call(ModuleRunner.java:63)
at org.scijava.thread.DefaultThreadService.lambda$wrap$2(DefaultThreadService.java:225)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
[INFO] Reading available sites from https://imagej.net/
WARNING: row index is bigger than sorter’s row count. Most likely this is a wrong sorter usage.
[INFO] Reading available sites from https://imagej.net/
io.scif.MissingLibraryException: Could not load TensorFlow. Check previous errors and warnings for details.
at net.imagej.modelzoo.consumer.model.tensorflow.TensorFlowModel.loadLibrary(TensorFlowModel.java:126)
at net.imagej.modelzoo.DefaultModelZooArchive.createModelInstance(DefaultModelZooArchive.java:104)
at net.imagej.modelzoo.consumer.DefaultModelZooPrediction.loadModel(DefaultModelZooPrediction.java:111)
at net.imagej.modelzoo.consumer.DefaultModelZooPrediction.run(DefaultModelZooPrediction.java:84)
at de.csbdresden.denoiseg.predict.DenoiSegPrediction.run(DenoiSegPrediction.java:92)
at net.imagej.modelzoo.consumer.commands.DefaultModelZooPredictionCommand.run(DefaultModelZooPredictionCommand.java:99)
at de.csbdresden.denoiseg.command.DenoiSegPredictCommand.run(DenoiSegPredictCommand.java:43)
at org.scijava.command.CommandModule.run(CommandModule.java:196)
at org.scijava.module.ModuleRunner.run(ModuleRunner.java:165)
at org.scijava.module.ModuleRunner.call(ModuleRunner.java:124)
at org.scijava.module.ModuleRunner.call(ModuleRunner.java:63)
at org.scijava.thread.DefaultThreadService.lambda$wrap$2(DefaultThreadService.java:225)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
[INFO] ModelZoo prediction exit (took 1275 milliseconds)
[ERROR] Module threw exception
java.lang.NullPointerException
at de.csbdresden.denoiseg.command.DenoiSegPredictCommand.run(DenoiSegPredictCommand.java:44)
at org.scijava.command.CommandModule.run(CommandModule.java:196)
at org.scijava.module.ModuleRunner.run(ModuleRunner.java:165)
at org.scijava.module.ModuleRunner.call(ModuleRunner.java:124)
at org.scijava.module.ModuleRunner.call(ModuleRunner.java:63)
at org.scijava.thread.DefaultThreadService.lambda$wrap$2(DefaultThreadService.java:225)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
[ERROR] Module threw exception
java.lang.ClassCastException: class jdk.internal.loader.ClassLoaders$AppClassLoader cannot be cast to class java.net.URLClassLoader (jdk.internal.loader.ClassLoaders$AppClassLoader and java.net.URLClassLoader are in module java.base of loader ‘bootstrap’)
at net.imagej.tensorflow.util.TensorFlowUtil.getTensorFlowJARVersion(TensorFlowUtil.java:79)
at net.imagej.tensorflow.util.TensorFlowUtil.versionFromClassPathJAR(TensorFlowUtil.java:94)
at net.imagej.tensorflow.ui.TensorFlowLibraryManagementCommand.getTensorFlowJARVersion(TensorFlowLibraryManagementCommand.java:112)
at net.imagej.tensorflow.ui.TensorFlowLibraryManagementCommand.initAvailableVersions(TensorFlowLibraryManagementCommand.java:98)
at net.imagej.tensorflow.ui.TensorFlowLibraryManagementCommand.run(TensorFlowLibraryManagementCommand.java:86)
at org.scijava.command.CommandModule.run(CommandModule.java:196)
at org.scijava.module.ModuleRunner.run(ModuleRunner.java:165)
at org.scijava.module.ModuleRunner.call(ModuleRunner.java:124)
at org.scijava.module.ModuleRunner.call(ModuleRunner.java:63)
at org.scijava.thread.DefaultThreadService.lambda$wrap$2(DefaultThreadService.java:225)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)

While I didn’t thoroughly understand what went wrong, I was able to solve my problem. Was a simple uninstall and reinstall of CSBDeep update site along with reselecting which TensorFlow model to use (most recent GPU version).