Dask-image ndfilters compatibility with cupy version > 10.6

I’m trying to use dask-image filters with cupy and I get an error when using cupy version 12.0.0 but not when using version 10.6.0.

To reproduce the error, I’m using a simple example that I found here (at the bottom of the page).

Using a conda environment with dask-image version 2023.03.0 and cupy version 12.0.0 I run the following code:

import cupy as cp
import dask.array as da
importdask_image.ndfilters
s = (10, 10)
a = da.from_array(cp.arange(int(cp.prod(cp.array(s)))).reshape(s), chunks=5)  # <- cupy dask array
w = cp.ones(a.ndim * (3,))  # <- cupy dask array
result = dask_image.ndfilters.convolve(a, w)


AttributeError: module ‘cupyx.scipy.ndimage’ has no attribute ‘filters’

From the cupy github, it seems to me that the structure of the package changed after version 10.6.0

So I tired the above code in a conda environment with cupy version 10.6.0 and dask-image version 2023.03.0 and everything seems to work without error.

Am I doing something wrong or is dask-image not compatible with recent versions of cupy?

Hi @JorgeGtz,

If you’ve identified this, then you are probably right, dask-image might not be compatible with cupy version > 10.6.0. I don’t think you’re doing something wrong at all.

I would recommend to open an issue directly on dask-image github issue tracker.

Thank you. I started the issue: Dask-image ndfilters not working with cupy version > 10.6 · Issue #324 · dask/dask-image · GitHub