Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Output images contain 0 pixels only #34

Open
haesleinhuepf opened this issue Jan 29, 2022 · 4 comments
Open

Output images contain 0 pixels only #34

haesleinhuepf opened this issue Jan 29, 2022 · 4 comments

Comments

@haesleinhuepf
Copy link

Hi Talley @tlambert03 ,

I'm just exploring pycudadecon and running into some issues. After applying it to some images, I retrieve output images with all pixels zero. Sometimes, I see errors like this one (I need to restart the juypter kernel then and afterwards, the same code works):

---------------------------------------------------------------------------
OSError                                   Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_1376/3905717240.py in <module>
----> 1 deconvolved = decon(image, psf)
      2 
      3 imshow(deconvolved)

~\miniconda3\envs\bio_39\lib\site-packages\pycudadecon\deconvolution.py in decon(images, psf, fpattern, **kwargs)
    375             while True:
    376                 out.append(
--> 377                     rl_decon(next_im, output_shape=ctx.out_shape, **decon_kwargs)
    378                 )
    379                 try:

~\miniconda3\envs\bio_39\lib\site-packages\pycudadecon\deconvolution.py in rl_decon(im, background, n_iters, shift, save_deskewed, output_shape, napodize, nz_blend, pad_val, dup_rev_z)
    165     if not im.flags["C_CONTIGUOUS"]:
    166         im = np.ascontiguousarray(im)
--> 167     RL_interface(
    168         im,
    169         nx,

~\miniconda3\envs\bio_39\lib\site-packages\pycudadecon\_ctyped.py in __call__(self, *args, **kw)
     71 
     72             def __call__(self, *args, **kw):
---> 73                 return self._func(*args, **kw)
     74 
     75             def __repr__(_self):

OSError: [WinError -529697949] Windows Error 0xe06d7363

I'm running on Windows 10 using an NVidia RTX 3050 Ti, using CUDA 10.2, GPU Driver version 30.0.14.9649.

You can reproduce my experiment using this notebook:
https://github.com/haesleinhuepf/BioImageAnalysisNotebooks/blob/main/docs/18a_deconvolution/deconvolution_pycudadecon.ipynb

It's not urgent btw. Any hint is appreciated though!

Thanks!
Robert

@tlambert03
Copy link
Owner

the most common bug issue in the upstream library is PSF/OTF shape. when you get this error, can you try padding/cropping the PSF? can't remember if it applies to Z as well, but maybe try something like 64 x 128 x128?

If that solves it, then perhaps we can figure out the failure patterns and pad/trim stuff on the python side before passing to C... (or, we can try to fix at https://github.com/scopetools/cudaDecon). If you want to figure out which library the error is in, you could also try using the CLI for cudadecon

@haesleinhuepf
Copy link
Author

I see, we had similar padding issues in clij-fft. Anyway, I just tried image and psf with shape 64x64x64, and the issue remains...

@tlambert03
Copy link
Owner

tlambert03 commented Jan 29, 2022

can you try the demo data and tell me if that works? https://github.com/tlambert03/pycudadecon/tree/master/test/test_data

and if not, could you send me your data?

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

No branches or pull requests

2 participants