Skip to content

[BHEU2024] Fix bioimage_inference tool with 3D images#1544

Closed
kostrykin wants to merge 3 commits intobgruening:masterfrom
kostrykin:dev/bioimaging
Closed

[BHEU2024] Fix bioimage_inference tool with 3D images#1544
kostrykin wants to merge 3 commits intobgruening:masterfrom
kostrykin:dev/bioimaging

Conversation

@kostrykin
Copy link
Copy Markdown
Collaborator

The tool yields an error when we try to use a 3D image. For example, using the 3DUNetArabidopsisApicalStemCells.pt model and an image with shape 256,256,2,1 yields the error:

Expected weight to be a vector of size equal to the number of channels in input, but got weight of shape [1] and input of shape [2, 256, 256]

Original PR for this tool: #1391
xref FAIR-imaging/galaxy-image-community#26

@kostrykin
Copy link
Copy Markdown
Collaborator Author

@anuprulez Any idea what might be going on here?

@anuprulez
Copy link
Copy Markdown
Contributor

@kostrykin I had a look into 3DUNetArabidopsisApicalStemCells.pt and its RDF file. In the RDF file, the test_input.npy is 4 dimensional

rdf

but when I load the NPY file, it is actually 5-dimensional. The 5-dimensional file works as correct test data with the associated Pytorch model. In the Galaxy tool, I use the information from the RDF file to find the right number and order of dimensions. But, for this 3DUNetArabidopsisApicalStemCells 3D mode, it seems to be different to me. Do we have separate information that can be used to provide the model to find the correct number of input file dimensions?

5d

@bgruening
Copy link
Copy Markdown
Owner

How do we proceed here?

@anuprulez
Copy link
Copy Markdown
Contributor

I spent some time last week fixing this issue but have not been successful. I am trying to include methods from bioimage.core package to assess the input size of the image. @bgruening can you assign this issue to me? thanks!

@bgruening
Copy link
Copy Markdown
Owner

@anuprulez sure, assigned :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants