Fiji updater and CSBDeep dependency

@frauzufall @bwilhelm @fjug @ctrueden

Hello all!

Technical question concerning imagej-tensorflow.jar and csbdeep.jar.
We provide our users with >50 shared machines and VMs and in order to make sure they all constantly share the same Fiji version, we deploy a controlled version of Fiji from which we removed the updater.jar in order to make sure that it be can’t updated.

Unfortunately, it seems to me that this updater.jar is listed as a dependency of both imagej-tensorflow.jar and csbdeep.jar (based on my limited understanding of the imagej updater) and is required to run CSBDeep plugins.

Unless you have a better idea to forbid uncontrolled updates than bluntly removing the updater.jar, do you think it would it be possible to remove this dependency?

Thanks!

Sebastien

I would like to add a global switch to the Updater that completely disables it without needing to remove the JAR. But we haven’t done that yet. There is a closed issue which discusses the matter in a bit more technical detail.

In the meantime, it should indeed work to delete the updater JAR.

Does the code fail to execute correctly without the updater JAR being present? What is the error message? IMHO, we should fix it to still work!

The issue is almost certainly due to this code in ImageJ TensorFlow:

$ git grep UpdaterUtil
src/main/java/net/imagej/tensorflow/ui/TensorFlowLibraryManagementCommand.java:import net.imagej.updater.util.UpdaterUtil;
src/main/java/net/imagej/tensorflow/ui/TensorFlowLibraryManagementCommand.java: String platform = UpdaterUtil.getPlatform();
src/main/java/net/imagej/tensorflow/util/TensorFlowUtil.java:import net.imagej.updater.util.UpdaterUtil;
src/main/java/net/imagej/tensorflow/util/TensorFlowUtil.java:   private static final String PLATFORM = UpdaterUtil.getPlatform();

But we should just put a try/catch around it, in case the updater is not available. But again, a stack trace would help narrow down where we should put it.

Or even better: it looks like the only usage of Updater code is to call the getPlatform() method? But we have the PlatformService already for that. @frauzufall Any reason you weren’t able to use the PlatformService functionality (or even org.scijava.util.PlatformUtils) here? Or just ignorance? If there’s no other reason, I can look at changing it over—just let me know.

3 Likes

Thanks!

A switch would be perfect indeed.

The code fails when starting a N2V or a CSBDeep demo pipeline.

When starting N2V train + predict pipeline:

[INFO] Load TensorFlow..
java.util.concurrent.ExecutionException: java.lang.NoClassDefFoundError: net/imagej/updater/util/UpdaterUtil
	at java.util.concurrent.FutureTask.report(FutureTask.java:122)
	at java.util.concurrent.FutureTask.get(FutureTask.java:192)
	at de.csbdresden.n2v.command.N2VTrainPredictCommand.run(N2VTrainPredictCommand.java:144)
	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.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:748)
Caused by: java.lang.NoClassDefFoundError: net/imagej/updater/util/UpdaterUtil
	at net.imagej.tensorflow.util.TensorFlowUtil.<clinit>(TensorFlowUtil.java:63)
	at net.imagej.tensorflow.DefaultTensorFlowService.getCrashFile(DefaultTensorFlowService.java:305)
	at net.imagej.tensorflow.DefaultTensorFlowService.loadLibrary(DefaultTensorFlowService.java:208)
	at de.csbdresden.n2v.train.N2VTraining.init(N2VTraining.java:173)
	at de.csbdresden.n2v.command.N2VTrainPredictCommand.mainThread(N2VTrainPredictCommand.java:165)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	... 4 more
Caused by: java.lang.ClassNotFoundException: net.imagej.updater.util.UpdaterUtil
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	... 10 more

Let me know if I can add anything.

Thanks @sebherbert. I am heavily focused on getting the new ImageJ website launched this week, but will look into updating imagej-tensorflow not to use imagej-updater classes soon. I’ve added this thread to my community tasks list.

2 Likes

Thanks!
No emergency at all!