Update to DJL 0.34.0 by petebankhead · Pull Request #1975 · qupath/qupath
Addresses #1974
Not ready to be merged yet: I find it does enable the use of PyTorch 2.7.1 (good!) but breaks the InstanSeg extension (bad!).
Reason seems... surprising.
We make calls to baseManager.debugDump(2). This attempts to create a substring of a UUID, which would be ok except that UUIDs aren't used any more.
The result is
java.lang.StringIndexOutOfBoundsException: Range [24, 21) out of bounds for length 21
at java.base/jdk.internal.util.Preconditions$1.apply(Preconditions.java:55)
at java.base/jdk.internal.util.Preconditions$1.apply(Preconditions.java:52)
at java.base/jdk.internal.util.Preconditions$4.apply(Preconditions.java:213)
at java.base/jdk.internal.util.Preconditions$4.apply(Preconditions.java:210)
at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:98)
at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckFromToIndex(Preconditions.java:112)
at java.base/jdk.internal.util.Preconditions.checkFromToIndex(Preconditions.java:349)
at java.base/java.lang.String.checkBoundsBeginEnd(String.java:4865)
at java.base/java.lang.String.substring(String.java:2834)
at java.base/java.lang.String.substring(String.java:2807)
at ai.djl.ndarray.BaseNDManager.debugDump(BaseNDManager.java:426)
at qupath.ext.instanseg.core.InstanSeg.runInstanSeg(InstanSeg.java:239)
We should be able to work around it by avoiding any use of debugDump - I've checked that removing this line means that InstanSeg can run. But I suspect this must affect others.