Trainable Weka Segmentation / Error when loading classifiers

weka
imagej

#1

Hello everyone,
recently I started using the Trainable Weka Segmentation and created several classifiers.
But when I wanted to load the classifiers to apply them to other images, an error occured.
The first notification said ‘Error while loading train header’, the second ‘Error when loading Weka classifier from file’. Additionaly the “Console”-Window opened.
I’m using ImageJ for Windows, does anyone know what the problem could be?
I would be really, really thankful!
Charlotte


#2

Dear @Charlie,

is it possible that your classifier files were corrupted somehow, for instance, when copying to a network share? Does even one of the classifiers work or does loading fail for all of them?

Does it show something in that window? If so, could you also copy and paste that content in here?

Best,
Stefan


#3

I got the same problem. Actually, you should wait until the saving classifier process finish before you load to another image(s). Even though the file is several MB big, it takes minutes.

P.S. when it hasn’t finish, u will see 2 .model files with same name


#4

Dear @ZeliangSu and @Charlie,

I have just made a new release that prevents the GUI from doing anything until the classifier is completely written to file. Please, update your plugin installation and give it a try.

Thanks a lot for reporting!


#5

I have the same problem as Charlie–“Error while loading train header.”

I spent all day yesterday creating an intricate model that worked well. Applied it to a number of images. Saved the classifier at the end of the day. Attempted to load the classifier this morning and get the above error message and “Error when loading Weka classifier from file.”

I could spend another entire day rebuilding the classifier, but if I’m going to run into the same issue in succeeding days, I won’t bother and will have to attempt a non-Weka solution.

Fiji and Trainable Weka are updated to the latest versions.

Any assistance would be appreciated.

Thanks,

Ash

Here’s the console output:
WARNING: core mtj jar files are not available as resources to this classloader (sun.misc.Launcher$AppClassLoader@c387f44)
java.io.EOFException
java.io.ObjectInputStream$BlockDataInputStream.peekByte(ObjectInputStream.java:2958)
java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1538)
java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2285)
java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2209)
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2067)
java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1571)
java.io.ObjectInputStream.readArray(ObjectInputStream.java:1973)
java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1565)
java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2285)
java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2209)
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2067)
java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1571)
java.io.ObjectInputStream.readArray(ObjectInputStream.java:1973)
java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1565)
java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2285)
java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2209)
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2067)
java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1571)
java.io.ObjectInputStream.readArray(ObjectInputStream.java:1973)
java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1565)
java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2285)
java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2209)
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2067)
java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1571)
java.io.ObjectInputStream.readArray(ObjectInputStream.java:1973)
java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1565)
java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2285)
java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2209)
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2067)
java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1571)
java.io.ObjectInputStream.readArray(ObjectInputStream.java:1973)
java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1565)
java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2285)
java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2209)
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2067)
java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1571)
java.io.ObjectInputStream.readArray(ObjectInputStream.java:1973)
java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1565)
java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2285)
java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2209)
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2067)
java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1571)
java.io.ObjectInputStream.readArray(ObjectInputStream.java:1973)
java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1565)
java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2285)
java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2209)
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2067)
java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1571)
java.io.ObjectInputStream.readArray(ObjectInputStream.java:1973)
java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1565)
java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2285)
java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2209)
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2067)
java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1571)
java.io.ObjectInputStream.readArray(ObjectInputStream.java:1973)
java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1565)
java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2285)
java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2209)
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2067)
java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1571)
java.io.ObjectInputStream.readArray(ObjectInputStream.java:1973)
java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1565)
java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2285)
java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2209)
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2067)
java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1571)
java.io.ObjectInputStream.readArray(ObjectInputStream.java:1973)
java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1565)
java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2285)
java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2209)
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2067)
java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1571)
java.io.ObjectInputStream.readArray(ObjectInputStream.java:1973)
java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1565)
java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2285)
java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2209)
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2067)
java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1571)
java.io.ObjectInputStream.readArray(ObjectInputStream.java:1973)
java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1565)
java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2285)
java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2209)
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2067)
java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1571)
java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2285)
java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2209)
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2067)
java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1571)
java.io.ObjectInputStream.readObject(ObjectInputStream.java:431)
trainableSegmentation.WekaSegmentation.internalLoadClassifier(WekaSegmentation.java:658)
trainableSegmentation.WekaSegmentation.loadClassifier(WekaSegmentation.java:733)
trainableSegmentation.Weka_Segmentation.loadClassifier(Weka_Segmentation.java:1907)
trainableSegmentation.Weka_Segmentation$1$1.run(Weka_Segmentation.java:404)
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
java.util.concurrent.FutureTask.run(FutureTask.java:266)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
java.lang.Thread.run(Thread.java:748)

at java.io.ObjectInputStream$BlockDataInputStream.peekByte(ObjectInputStream.java:2958)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1538)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2285)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2209)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2067)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1571)
at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1973)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1565)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2285)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2209)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2067)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1571)
at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1973)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1565)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2285)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2209)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2067)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1571)
at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1973)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1565)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2285)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2209)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2067)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1571)
at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1973)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1565)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2285)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2209)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2067)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1571)
at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1973)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1565)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2285)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2209)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2067)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1571)
at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1973)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1565)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2285)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2209)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2067)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1571)
at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1973)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1565)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2285)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2209)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2067)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1571)
at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1973)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1565)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2285)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2209)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2067)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1571)
at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1973)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1565)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2285)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2209)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2067)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1571)
at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1973)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1565)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2285)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2209)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2067)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1571)
at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1973)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1565)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2285)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2209)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2067)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1571)
at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1973)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1565)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2285)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2209)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2067)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1571)
at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1973)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1565)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2285)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2209)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2067)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1571)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2285)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2209)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2067)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1571)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:431)
at trainableSegmentation.WekaSegmentation.internalLoadClassifier(WekaSegmentation.java:658)
at trainableSegmentation.WekaSegmentation.loadClassifier(WekaSegmentation.java:733)
at trainableSegmentation.Weka_Segmentation.loadClassifier(Weka_Segmentation.java:1907)
at trainableSegmentation.Weka_Segmentation$1$1.run(Weka_Segmentation.java:404)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
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)