AllenCellModeling / pytorch_fnet

Three dimensional cross-modal image inference
Other
151 stars 61 forks source link

cannot unsqueeze empty tensor #181

Open ateneyck1 opened 3 years ago

ateneyck1 commented 3 years ago

Description

A clear description of the bug

I have used 5 images that have previously work and wanted to see if I can reduce the z stack of the image. I used zen to take the images from 50+ stacks to a reduced number to see how the prediction would work. When using my previously trained model on these new images at a reduced z stack, I get the error:

DEBUG: cropper shape change [0, 544, 544] becomes (0, 544, 544) Traceback (most recent call last): File "predict.py", line 118, in main() File "predict.py", line 90, in main data = [torch.unsqueeze(d, 0) for d in dataset[idx]] # make batch of size 1 File "/home/ec2-user/pytorch_fnet-release_1/fnet/data/czidataset.py", line 52, in getitem im_out = [torch.unsqueeze(im, 0) for im in im_out] File "/home/ec2-user/pytorch_fnet-release_1/fnet/data/czidataset.py", line 52, in im_out = [torch.unsqueeze(im, 0) for im in im_out] RuntimeError: cannot unsqueeze empty tensor

Expected Behavior

What did you expect to happen instead?

i expect an image to be outputted

Reproduction

A minimal example that exhibits the behavior.

original and reduced image attached

Environment

Any additional information about your environment

environment is the same as the published paper

ateneyck1 commented 3 years ago

https://gtvault-my.sharepoint.com/:f:/g/personal/aeyck3_gatech_edu/EjPeVIvlMCdMmupDtnVkM2gB9PsK1ZcJCEv8_MU8dphWvg?e=m6UYDA