deepimagej / deepimagej-plugin

The ImageJ plugin to run deep-learning models
https://deepimagej.github.io/deepimagej/
BSD 2-Clause "Simplified" License
86 stars 12 forks source link

batch size error on FIJI #23

Closed pr4deepr closed 3 years ago

pr4deepr commented 3 years ago

Hi I downloaded a deepImageJ model from bioimage model zoo for FIJI. Using DeepImageJ plugin, I tested it on the example image stack that came with the model.

3D U-Net Arabidopsis model

On the example image, I get this error in the Log Window:

Error applying the model
Output batch size bigger than 1 for tensor 'output'.
 Batch_size > 1 not supported by this version of DeepImageJ
Output tensor 'output' with tensor organization -> BYXC, and dimensions -> [256, 256, 8, 1], has a batch of 256. This version of DeepImageJ only supports batch sizes of 1.

When running DeepImageJ: image

the tile size is 256,256,8,1 (Y,X,Z,C) , but the output in the log file has mentioned 256,256,8,1 and batch size of 256??


Also, a suggestion for the per_sample_scale_range.ijm macro On line 33, when it checks if the image is RGB, this doesn't work for images that have a lookup table other than "Grays" If my image had a "Red" or "Magenta" lookup table, it will think its an RGB image and run the RGB processing. This is particularly a problem as most of the images from the microscopes have some sort of LUT applied to it

pr4deepr commented 3 years ago

Just saw this other issue: https://github.com/deepimagej/deepimagej-plugin/issues/20 Are they related?

esgomezm commented 3 years ago

Hi @pr4deepr

Thank you very much for the issue and apologies for the delayed answer.

There's an error in the model.yaml, where we specify the dimensions of the output (it's given as byxzc and should be yxzc). I have corrected it, so hopefully, the model should be updated tomorrow morning.

For the per_sample_scale_range.ijm, could you please try substituting that line by flag_rgb = is("RGB"); and tell us whether it worked for you?

Thank you

pr4deepr commented 3 years ago

Hi @esgomezm Thanks for that. I did try that when I was playing around with the model.yaml file and got this error: image

I have NOT tried it with a new model downloaded from bioimage model zoo though..

For per_sample_scale_range.ijm, as its ImageJ macro, I don't think there is an is("RGB") command. Atleast I couldn't find it.

Cheers Pradeep

pr4deepr commented 3 years ago

Hi

The model inference is working now. Thanks so much! The RGB bug is still there, but otherwise its working fine. The fix you mentioned doesn't work as its an ImageJ macro.

Appreciate the prompt reponses.

Cheers Pradeep