Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

StarDist 2D bugging after latest updates of ImageJ #23

Open
ctrueden opened this issue Jan 28, 2025 · 4 comments
Open

StarDist 2D bugging after latest updates of ImageJ #23

ctrueden opened this issue Jan 28, 2025 · 4 comments

Comments

@ctrueden
Copy link

In imagej/ImageJ#267, @mpalaibmb wrote:

Good morning everyone!
This morning, while initializing ImageJ, it proposed me numerous updates that I accepted as usual.
The problem is that after them, StarDist 2D plugin, which is the one I use mostly for my analysis, started to bug.
I attach following the type of error that it gives me, which before today I never had:

[INFO] No TF library found in C:\Users\mpabm\DOWNLO~1\FIJI-W~1\Fiji.app\lib\.
[INFO] Using default TensorFlow version from JAR: TF 1.15.0 CPU
[INFO] Loading TensorFlow model GenericNetwork_aea3be563cb56b8824f53a8c2382aaa5 from source file file:/C:/Users/mpabm/AppData/Local/Temp/stardist_model_8155415352555340585.zip
[INFO] Caching TensorFlow models to C:\Users\mpabm\DOWNLO~1\FIJI-W~1\Fiji.app\models
java.util.concurrent.ExecutionException: java.lang.NoSuchMethodError: org.tensorflow.framework.MetaGraphDef.makeExtensionsImmutable()V
	at java.util.concurrent.FutureTask.report(FutureTask.java:122)
	at java.util.concurrent.FutureTask.get(FutureTask.java:192)
	at de.csbdresden.csbdeep.commands.GenericCoreNetwork.run(GenericCoreNetwork.java:420)
	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:125)
	at org.scijava.module.ModuleRunner.call(ModuleRunner.java:64)
	at org.scijava.thread.DefaultThreadService.lambda$wrap$2(DefaultThreadService.java:247)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:750)
Caused by: java.lang.NoSuchMethodError: org.tensorflow.framework.MetaGraphDef.makeExtensionsImmutable()V
	at org.tensorflow.framework.MetaGraphDef.<init>(MetaGraphDef.java:168)
	at org.tensorflow.framework.MetaGraphDef.<init>(MetaGraphDef.java:25)
	at org.tensorflow.framework.MetaGraphDef$1.parsePartialFrom(MetaGraphDef.java:4257)
	at org.tensorflow.framework.MetaGraphDef$1.parsePartialFrom(MetaGraphDef.java:4252)
	at com.google.protobuf.AbstractParser.parsePartialFrom(AbstractParser.java:135)
	at com.google.protobuf.AbstractParser.parseFrom(AbstractParser.java:168)
	at com.google.protobuf.AbstractParser.parseFrom(AbstractParser.java:180)
	at com.google.protobuf.AbstractParser.parseFrom(AbstractParser.java:185)
	at com.google.protobuf.AbstractParser.parseFrom(AbstractParser.java:25)
	at org.tensorflow.framework.MetaGraphDef.parseFrom(MetaGraphDef.java:2680)
	at de.csbdresden.csbdeep.network.model.tensorflow.TensorFlowNetwork.loadModel(TensorFlowNetwork.java:174)
	at de.csbdresden.csbdeep.network.model.DefaultNetwork.loadModel(DefaultNetwork.java:76)
	at de.csbdresden.csbdeep.network.DefaultModelLoader.loadNetwork(DefaultModelLoader.java:69)
	at de.csbdresden.csbdeep.network.DefaultModelLoader.run(DefaultModelLoader.java:48)
	at de.csbdresden.csbdeep.commands.GenericCoreNetwork.tryToPrepareInputAndNetwork(GenericCoreNetwork.java:524)
	at de.csbdresden.csbdeep.commands.GenericCoreNetwork.initiateModelIfNeeded(GenericCoreNetwork.java:303)
	at de.csbdresden.csbdeep.commands.GenericCoreNetwork.mainThread(GenericCoreNetwork.java:445)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	... 4 more
[INFO] CSBDeep plugin exit (took 861 milliseconds)
[ERROR] Command errored: StarDist 2D
java.lang.NullPointerException
	at de.csbdresden.stardist.StarDist2D.splitPrediction(StarDist2D.java:338)
	at de.csbdresden.stardist.StarDist2D.run(StarDist2D.java:307)
	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:125)
	at org.scijava.module.ModuleRunner.call(ModuleRunner.java:64)
	at org.scijava.thread.DefaultThreadService.lambda$wrap$2(DefaultThreadService.java:247)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:750)

I tried to update TF models, used them through a GPU, and download new packages and versions of CUDA and cuDNN.
But nothing changed. Maybe I am missing the point.

Thank you in advance for whoever can provide me with insights!

@ctrueden
Copy link
Author

I am able to reproduce this error on my Ubuntu Linux 24.04 system with a Fiji that has the CSBDeep and StarDist update sites freshly enabled.

I tried Edit → Options → TensorFlow... to swap the versions around between 1.15 and 1.12, both CPU and GPU, but still receive the same error regardless.

@uschmidt83 Any idea what could have changed?

@mpalaibmb
Copy link

@ctrueden I actually resolved my problem changing to 1.12 version.
I saw that many people with Windows as me are having this error, so maybe since you have Linux can be different!

@ctrueden
Copy link
Author

@mpalaibmb Glad it is working for you now! I wonder though if there is something we could fix on the CSBDeep and/or StarDist update sites so that it works out of the box...

@uschmidt83
Copy link
Member

All the TensorFlow stuff is being handled by the CSBDeep plugin, which is unfortunately unmaintained. It's some sort of miracle that it still works to this day, to be honest.

Similar issues have been discussed in the image.sc forum, including me being confused on this topic.

Sorry that I don't have a better answer for you at the moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants