Skip to content

StarDist3D #47

@stefanhahmann

Description

@stefanhahmann

I tried running StarDist3D with a small dummy dataset:

import java.io.IOException;
import java.net.URISyntaxException;

import net.imglib2.img.Img;
import net.imglib2.img.array.ArrayImgs;
import net.imglib2.type.numeric.real.FloatType;

import org.apache.commons.compress.archivers.ArchiveException;

import io.bioimage.modelrunner.apposed.appose.MambaInstallException;
import io.bioimage.modelrunner.bioimageio.description.exceptions.ModelSpecsException;
import io.bioimage.modelrunner.exceptions.LoadEngineException;
import io.bioimage.modelrunner.exceptions.LoadModelException;
import io.bioimage.modelrunner.exceptions.RunModelException;
import io.bioimage.modelrunner.model.Stardist3D;

public class Stardist3DDummyPrediction
{
	public static void main( String[] args )
			throws MambaInstallException, IOException, URISyntaxException, ArchiveException, InterruptedException, ModelSpecsException,
			LoadEngineException, RunModelException, LoadModelException
	{
		Stardist3D.installRequirements();
		Stardist3D stardist3D = Stardist3D.fromPretained( "StarDist Plant Nuclei 3D ResNet", false );
		final Img< FloatType > dummyImg = ArrayImgs.floats( 10, 10, 10 );
		stardist3D.predict( dummyImg );
	}
}

When trying to run this, I get:


Exception in thread "main" Error loading a Deep Learning engine located at tensorflow-1.15.0-1.15.0-windows-x86_64-cpu-gpu.
java.lang.reflect.InvocationTargetException
	at io.bioimage.modelrunner.engine.EngineLoader.setEngineInstance(EngineLoader.java:330)
	at io.bioimage.modelrunner.engine.EngineLoader.<init>(EngineLoader.java:138)
	at io.bioimage.modelrunner.engine.EngineLoader.createEngine(EngineLoader.java:159)
	at io.bioimage.modelrunner.model.Model.setEngineClassLoader(Model.java:480)
	at io.bioimage.modelrunner.model.Model.<init>(Model.java:142)
	at io.bioimage.modelrunner.model.Model.createBioimageioModel(Model.java:319)
	at io.bioimage.modelrunner.model.Model.createBioimageioModel(Model.java:258)
	at io.bioimage.modelrunner.model.Model.createBioimageioModel(Model.java:236)
	at io.bioimage.modelrunner.model.Stardist3D.predict(Stardist3D.java:245)
	at main(Stardist3DInstallRequirements.java:28)

This behavior is unexpected. It happens on Windows machine with JDK-21 (not sure, if this OS related or Java-version related).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions