juglab / N2V_fiji

BSD 2-Clause "Simplified" License
21 stars 3 forks source link

Incompatibility with new imglib2-cache? #28

Closed caylamiller closed 3 years ago

caylamiller commented 3 years ago

Hello, I recently installed a new version of the imglib2-cache jar (released Feb 22) when adding another update site and it seemed to break n2v. I was able to train data but would get an error related to this jar when trying to predict. I rolled it back to a previous version of the file I had (beta-13, whereas the newer one was I think beta-16) and n2v works fine now for me. I'm assuming this might cause problems for others newly installing n2v (or updating other plugins) so wanted to let ya'll know. :)

fjug commented 3 years ago

Thanks a lot for pointing this out... we will look into that! @tpietzsch @maarzt @tibuch (and maybe @frauzufall)

jdeschamps commented 3 years ago

For reference, this is probably the exception encountered:

java.lang.NoClassDefFoundError: net/imglib2/cache/img/DiskCachedCellImgOptions$CacheType
    at net.imagej.modelzoo.consumer.tiling.TiledImageDataReference.createTiledOutputView(TiledImageDataReference.java:204)
    at net.imagej.modelzoo.consumer.tiling.TiledImageDataReference.createTiledOutputView(TiledImageDataReference.java:163)
    at net.imagej.modelzoo.consumer.tiling.DefaultTiling.init(DefaultTiling.java:105)
    at net.imagej.modelzoo.consumer.TiledPredictionExecutor.initTiling(TiledPredictionExecutor.java:188)
    at net.imagej.modelzoo.consumer.TiledPredictionExecutor.run(TiledPredictionExecutor.java:84)
    at net.imagej.modelzoo.consumer.AbstractModelZooPrediction.executePrediction(AbstractModelZooPrediction.java:210)
    at net.imagej.modelzoo.consumer.AbstractModelZooPrediction.run(AbstractModelZooPrediction.java:105)
    at net.imagej.modelzoo.consumer.command.AbstractSingleImagePredictionCommand.run(AbstractSingleImagePredictionCommand.java:101)
    at de.csbdresden.n2v.command.N2VPredictCommand.run(N2VPredictCommand.java:59)
    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.ClassNotFoundException: net.imglib2.cache.img.DiskCachedCellImgOptions$CacheType
    at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
    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)
    ... 18 more

The newest imglib2-cache version on the update site is 1.0.0-beta-16. Since https://github.com/imglib/imglib2-cache/commit/3d269bf7107736100c4e99b4e6093c49cee39b51, CacheType has been moved to CacheOptions.java.

The problem is actually in imagej-modelzoo and it probably needs to be recompiled and updated on the update site in order to point to the correct Class path.

edit: by updating model-zoo pom to scijava-pom 30.0.0, and recompiling, the error disappears. I will open an github issue on the imagej-modelzoo repo. -> see issue

jdeschamps commented 3 years ago

Hi!

I fixed and updated imagej-modelzoo on FIji, so N2V and DenoiSeg should be working again now.

Thanks again for letting us know!