mstritt/orbit-image-analysis

Null pointer exception

dkurt opened this issue · 3 comments

dkurt commented

Hi! I'm trying to run a script from https://www.orbit.bio/deep-learning-models/ in command line:

$ groovy -cp "build/libs/orbit-image-analysis-3.64.jar:build/libs/lib/*" src/main/groovy/com/actelion/research/orbit/imageAnalysis/scripts/deepLearning/DeepLearningSegmentation.groovy 

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.codehaus.groovy.vmplugin.v7.Java7$1 (file:/home/dkurt/orbit-image-analysis/build/libs/lib/groovy-2.5.7.jar) to constructor java.lang.invoke.MethodHandles$Lookup(java.lang.Class,int)
WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.vmplugin.v7.Java7$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
2021-01-25 20:11:58.168786: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
2021-01-25 20:11:58.192078: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 4008000000 Hz
2021-01-25 20:11:58.192452: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x7fe029b82c40 executing computations on platform Host. Devices:
2021-01-25 20:11:58.192477: I tensorflow/compiler/xla/service/service.cc:175]   StreamExecutor device (0): <undefined>, <undefined>
using Tensorflow 1.14.0
20:11:58.444 INFO  c.a.r.o.i.dal.DALConfig:230 - using config file: resources/config.properties 
20:11:58.448 INFO  c.a.r.o.i.dal.DALConfig:74 - Configured image provider: com.actelion.research.orbit.imageprovider.ImageProviderOmero
20:11:58.448 INFO  c.a.r.o.i.dal.DALConfig:75 - Different image providers can be configured in resources/config.properties or resources/config_custom.properties (priority).
20:11:58.466 INFO  c.a.r.o.i.ImageProviderOmero:133 - searching for OrbitOmero.properties in current directory (/home/dkurt/orbit-image-analysis)
20:11:58.478 INFO  c.a.r.o.i.ImageProviderOmero:143 - searching for OrbitOmero.properties in user home (/home/dkurt)
20:11:58.488 INFO  c.a.r.o.i.ImageProviderOmero:176 - Omero host: localhost
20:11:58.490 INFO  c.a.r.o.i.ImageProviderOmero:177 - Omero port: 4064
20:11:58.490 INFO  c.a.r.o.i.ImageProviderOmero:178 - Omero web port: 443
20:11:58.491 INFO  c.a.r.o.i.ImageProviderOmero:179 - Omero use SSL: false
20:11:58.491 INFO  c.a.r.o.i.ImageProviderOmero:180 - Omero use WebSockets: false
20:11:58.491 INFO  c.a.r.o.i.ImageProviderOmero:181 - Search limit: 1000
20:11:58.491 INFO  c.a.r.o.i.ImageProviderOmero:182 - Omero User Scaleout: 
20:11:58.503 WARN  c.a.r.o.i.dal.DALConfig:85 - Orbit will continue with the fallback local filesystem image provider.
20:11:58.507 INFO  c.a.r.o.i.dal.DALConfig:104 - scaleout mode: true
20:11:58.509 INFO  c.a.r.o.i.dal.DALConfig:152 - image provider: com.actelion.research.orbit.imageAnalysis.dal.ImageProviderLocal@7c2312fa
20:11:58.510 INFO  c.a.r.o.i.dal.DALConfig:153 - scaleOut: com.actelion.research.orbit.imageAnalysis.dal.ScaleoutNoop@4cb0a000
20:11:58.511 INFO  c.a.r.o.i.dal.DALConfig:169 - local db file: /home/dkurt/orbit.db
Caught: java.lang.NullPointerException
java.lang.NullPointerException
        at com.actelion.research.orbit.imageAnalysis.deeplearning.DLSegment.generateSegmentationAnnotations(DLSegment.java:87)
        at com.actelion.research.orbit.imageAnalysis.deeplearning.DLSegment.generateSegmentationAnnotations(DLSegment.java:78)
        at com.actelion.research.orbit.imageAnalysis.deeplearning.DLSegment$generateSegmentationAnnotations$0.call(Unknown Source)
        at DeepLearningSegmentation.run(DeepLearningSegmentation.groovy:50)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

orbit.db exists (downloaded from https://doi.org/10.5061/dryad.fqz612jpc). But there is an error at the following line because rdf is null:

/cc @mstritt

dkurt commented

With sqlitebrowser found valid ids:

int[] images = [88]

Going to fix subsequent error:

logs
13:23:27.208 INFO  c.a.r.o.i.d.DLSegment:88 - rdfid: 88
java.io.FileNotFoundException: /train/6666718.tiff (No such file or directory)
        at java.base/java.io.RandomAccessFile.open0(Native Method)
        at java.base/java.io.RandomAccessFile.open(RandomAccessFile.java:345)
        at java.base/java.io.RandomAccessFile.<init>(RandomAccessFile.java:259)
        at java.base/java.io.RandomAccessFile.<init>(RandomAccessFile.java:214)
        at loci.common.NIOFileHandle.<init>(NIOFileHandle.java:130)
        at loci.common.NIOFileHandle.<init>(NIOFileHandle.java:151)
        at loci.common.NIOFileHandle.<init>(NIOFileHandle.java:165)
        at loci.common.Location.getHandle(Location.java:522)
        at loci.common.Location.getHandle(Location.java:462)
        at loci.common.Location.getHandle(Location.java:443)
        at loci.common.Location.getHandle(Location.java:426)
        at loci.common.RandomAccessInputStream.<init>(RandomAccessInputStream.java:125)
        at loci.formats.tiff.TiffParser.<init>(TiffParser.java:105)
        at com.actelion.research.orbit.imageAnalysis.dal.localImage.OrbitImageTiff$1.initialValue(OrbitImageTiff.java:117)
        at com.actelion.research.orbit.imageAnalysis.dal.localImage.OrbitImageTiff$1.initialValue(OrbitImageTiff.java:113)
        at java.base/java.lang.ThreadLocal.setInitialValue(ThreadLocal.java:195)
        at java.base/java.lang.ThreadLocal.get(ThreadLocal.java:172)
        at com.actelion.research.orbit.imageAnalysis.dal.localImage.OrbitImageTiff.<init>(OrbitImageTiff.java:124)
        at com.actelion.research.orbit.imageAnalysis.dal.ImageProviderLocal.createOrbitImage(ImageProviderLocal.java:283)
        at com.actelion.research.orbit.imageAnalysis.utils.TiledImagePainter.loadImage(TiledImagePainter.java:182)
        at com.actelion.research.orbit.imageAnalysis.utils.TiledImagePainter.loadImage(TiledImagePainter.java:176)
        at com.actelion.research.orbit.imageAnalysis.utils.TiledImagePainter.loadImage(TiledImagePainter.java:171)
        at com.actelion.research.orbit.imageAnalysis.components.RecognitionFrame.loadImage(RecognitionFrame.java:555)
        at com.actelion.research.orbit.imageAnalysis.components.RecognitionFrame.loadImage(RecognitionFrame.java:534)
        at com.actelion.research.orbit.imageAnalysis.components.RecognitionFrame.<init>(RecognitionFrame.java:165)
        at com.actelion.research.orbit.imageAnalysis.components.RecognitionFrame.<init>(RecognitionFrame.java:152)
        at com.actelion.research.orbit.imageAnalysis.deeplearning.DLSegment.generateSegmentationAnnotations(DLSegment.java:99)
        at com.actelion.research.orbit.imageAnalysis.deeplearning.DLSegment.generateSegmentationAnnotations(DLSegment.java:78)
        at com.actelion.research.orbit.imageAnalysis.deeplearning.DLSegment$generateSegmentationAnnotations$0.call(Unknown Source)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:115)
        at DeepLearningSegmentation.run(DeepLearningSegmentation.groovy:50)
        at groovy.lang.GroovyShell.runScriptOrMainOrTestOrRunnable(GroovyShell.java:260)
        at groovy.lang.GroovyShell.run(GroovyShell.java:370)
        at groovy.lang.GroovyShell.run(GroovyShell.java:359)
        at groovy.ui.GroovyMain.processOnce(GroovyMain.java:592)
        at groovy.ui.GroovyMain.run(GroovyMain.java:336)
        at groovy.ui.GroovyMain.access$1400(GroovyMain.java:69)
        at groovy.ui.GroovyMain$GroovyCommand.process(GroovyMain.java:295)
        at groovy.ui.GroovyMain.processArgs(GroovyMain.java:134)
        at groovy.ui.GroovyMain.main(GroovyMain.java:116)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at org.codehaus.groovy.tools.GroovyStarter.rootLoader(GroovyStarter.java:116)
        at org.codehaus.groovy.tools.GroovyStarter.main(GroovyStarter.java:138)
13:23:27.269 ERROR c.a.r.o.i.c.RecognitionFrame:559 - Error loading image. Probably the Orbit image server down or not accessible.
Error Details: 
com.actelion.research.orbit.exceptions.OrbitImageServletException: Tiffparser error, cannot open tiff file /train/6666718.tiff
        at com.actelion.research.orbit.imageAnalysis.dal.localImage.OrbitImageTiff.<init>(OrbitImageTiff.java:124)
        at com.actelion.research.orbit.imageAnalysis.dal.ImageProviderLocal.createOrbitImage(ImageProviderLocal.java:283)
Caught: com.actelion.research.orbit.exceptions.OrbitImageServletException: Tiffparser error, cannot open tiff file /train/6666718.tiff
com.actelion.research.orbit.exceptions.OrbitImageServletException: Tiffparser error, cannot open tiff file /train/6666718.tiff
        at com.actelion.research.orbit.imageAnalysis.components.RecognitionFrame.loadImage(RecognitionFrame.java:561)
        at com.actelion.research.orbit.imageAnalysis.components.RecognitionFrame.loadImage(RecognitionFrame.java:534)
        at com.actelion.research.orbit.imageAnalysis.components.RecognitionFrame.<init>(RecognitionFrame.java:165)
        at com.actelion.research.orbit.imageAnalysis.components.RecognitionFrame.<init>(RecognitionFrame.java:152)
        at com.actelion.research.orbit.imageAnalysis.deeplearning.DLSegment.generateSegmentationAnnotations(DLSegment.java:99)
        at com.actelion.research.orbit.imageAnalysis.deeplearning.DLSegment.generateSegmentationAnnotations(DLSegment.java:78)
        at com.actelion.research.orbit.imageAnalysis.deeplearning.DLSegment$generateSegmentationAnnotations$0.call(Unknown Source)
        at DeepLearningSegmentation.run(DeepLearningSegmentation.groovy:50)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
dkurt commented

@mstritt, thank you! I also solved cannot open tiff file /train/6666718.tiff error by creation of symbolic link:

sudo ln -s ~/train/ /train

Maybe there is more elegant way to manage it but at least I'm now able to run segmentation. Many thanks for fast response!