knime-ip / knip-ilastik

KNIP / Ilastik Integration (BETA)
5 stars 1 forks source link

IOException when running Ilastik Headless #19

Open imagejan opened 7 years ago

imagejan commented 7 years ago

I got the following exception when running the Ilastik Headless (Pixel classification) node inside a parallel chunk loop with a few thousand 2D multi-channel images (x=1020, y=1024, c=3):

java.lang.IllegalStateException: java.io.IOException: Cannot run program "C:\Program Files\ilastik-1.2.0\ilastik.exe": CreateProcess error=206, The filename or extension is too long
    at org.knime.knip.ilastik.nodes.headless.IlastikHeadlessNodeModel.execute(IlastikHeadlessNodeModel.java:339)
    at org.knime.core.node.NodeModel.execute(NodeModel.java:732)
    at org.knime.core.node.NodeModel.executeModel(NodeModel.java:566)
    at org.knime.core.node.Node.invokeFullyNodeModelExecute(Node.java:1128)
    at org.knime.core.node.Node.execute(Node.java:915)
    at org.knime.core.node.workflow.NativeNodeContainer.performExecuteNode(NativeNodeContainer.java:561)
    at org.knime.core.node.exec.LocalNodeExecutionJob.mainExecute(LocalNodeExecutionJob.java:95)
    at org.knime.core.node.workflow.NodeExecutionJob.internalRun(NodeExecutionJob.java:179)
    at org.knime.core.node.workflow.NodeExecutionJob.run(NodeExecutionJob.java:110)
    at org.knime.core.util.ThreadUtils$RunnableWithContextImpl.runWithContext(ThreadUtils.java:328)
    at org.knime.core.util.ThreadUtils$RunnableWithContext.run(ThreadUtils.java:204)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at org.knime.core.util.ThreadPool$MyFuture.run(ThreadPool.java:123)
    at org.knime.core.util.ThreadPool$Worker.run(ThreadPool.java:246)
Caused by: java.io.IOException: Cannot run program "C:\Program Files\ilastik-1.2.0\ilastik.exe": CreateProcess error=206, The filename or extension is too long
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
    at org.knime.knip.ilastik.nodes.headless.IlastikHeadlessNodeModel.runIlastik(IlastikHeadlessNodeModel.java:480)
    at org.knime.knip.ilastik.nodes.headless.IlastikHeadlessNodeModel.execute(IlastikHeadlessNodeModel.java:307)
    ... 14 more
Caused by: java.io.IOException: CreateProcess error=206, The filename or extension is too long
    at java.lang.ProcessImpl.create(Native Method)
    at java.lang.ProcessImpl.<init>(ProcessImpl.java:386)
    at java.lang.ProcessImpl.start(ProcessImpl.java:137)
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
    ... 16 more

It was running fine before with a smaller dataset, but failed when trying to scale it up.

Looking at this code, I think this might be solved by chunking List<String> inFiles if it gets too big, and running several processes.

I try to work around this now by chunking in smaller pieces within KNIME.

JeremyPike commented 6 years ago

Hi, I also get this exception when running the Ilastik Headless (Pixel classification) node with more than a few hundred images (just 2D single channel in my case though and not within a parallel chunk loop).

Thanks @imagejan for the workaround!