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

find_objects throws AttributeError #355

Closed
tibuch opened this issue Mar 8, 2024 · 4 comments
Closed

find_objects throws AttributeError #355

tibuch opened this issue Mar 8, 2024 · 4 comments

Comments

@tibuch
Copy link

tibuch commented Mar 8, 2024

Describe the issue:
I am trying to use dask_image.ndmeasure.find_objects for bounding box detection. I have a label-image (dtype int32) with values [0, 149] of shape = (249, 1000, 1250).

This is my dataset: labeling.zarr.zip

This is the error:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Cell In[62], line 1
----> 1 bbox_df = dask_image.ndmeasure.find_objects(tmp).compute()

File .../run-stardist/lib/python3.11/site-packages/dask/base.py:375, in DaskMethodsMixin.compute(self, **kwargs)
    351 def compute(self, **kwargs):
    352     """Compute this dask collection
    353 
    354     This turns a lazy Dask collection into its in-memory equivalent.
   (...)
    373     dask.compute
    374     """
--> 375     (result,) = compute(self, traverse=False, **kwargs)
    376     return result

File .../run-stardist/lib/python3.11/site-packages/dask/base.py:661, in compute(traverse, optimize_graph, scheduler, get, *args, **kwargs)
    658     postcomputes.append(x.__dask_postcompute__())
    660 with shorten_traceback():
--> 661     results = schedule(dsk, keys, **kwargs)
    663 return repack([f(r, *a) for r, (f, a) in zip(results, postcomputes)])

File .../run-stardist/lib/python3.11/site-packages/dask_image/ndmeasure/_utils/_find_objects.py:60, in _merge_bounding_boxes(x, ndim)
     55 for i in range(ndim):
     56     # Array dimensions are labelled by a number followed by an underscroe
     57     # i.e. column labels are: 0_x, 1_x, 2_x, ... 0_y, 1_y, 2_y, ...
     58     # (x and y represent the pair of chunks label slices are merged from)
     59     slices = [x[ii] for ii in x.index if str(ii).startswith(str(i))]
---> 60     combined_slices = _combine_slices(slices)
     61     data[i] = combined_slices
     62 result = pd.Series(data=data, index=[i for i in range(ndim)], name=x.name)

File .../run-stardist/lib/python3.11/site-packages/dask_image/ndmeasure/_utils/_find_objects.py:42, in _combine_slices(slices)
     40     return slices[0]
     41 else:
---> 42     start = min([sl.start for sl in slices])
     43     stop = max([sl.stop for sl in slices])
     44     return slice(start, stop)

File .../run-stardist/lib/python3.11/site-packages/dask_image/ndmeasure/_utils/_find_objects.py:42, in <listcomp>(.0)
     40     return slices[0]
     41 else:
---> 42     start = min([sl.start for sl in slices])
     43     stop = max([sl.stop for sl in slices])
     44     return slice(start, stop)

AttributeError: 'str' object has no attribute 'start'

Minimal Complete Verifiable Example:

import dask.array as da
import dask_image 

labeling = da.from_zarr('labeling.zarr')
bbox_df = dask_image.ndmeasure.find_objects(labeling).compute()

Anything else we need to know?:

Environment:

  • Dask version: 2024.2.1
  • Dask-core version: 2024.2.1
  • Dask-image version: 2023.8.1
  • Python version: 3.11.8
  • Operating System: Operating System: Rocky Linux 8.6 (Green Obsidian); Kernel: Linux 4.18.0-372.26.1.el8_6.x86_64; Architecture: x86-64
  • Install method (conda, pip, source): mamba

Full Env:

# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                 conda_forge    conda-forge
_openmp_mutex             4.5                       2_gnu    conda-forge
absl-py                   2.1.0              pyhd8ed1ab_0    conda-forge
aiohttp                   3.9.3           py311h459d7ec_0    conda-forge
aiosignal                 1.3.1              pyhd8ed1ab_0    conda-forge
anyio                     4.3.0              pyhd8ed1ab_0    conda-forge
aom                       3.8.1                h59595ed_0    conda-forge
appdirs                   1.4.4              pyh9f0ad1d_0    conda-forge
argon2-cffi               23.1.0             pyhd8ed1ab_0    conda-forge
argon2-cffi-bindings      21.2.0          py311h459d7ec_4    conda-forge
arrow                     1.3.0              pyhd8ed1ab_0    conda-forge
asciitree                 0.3.3                      py_2    conda-forge
asttokens                 2.4.1              pyhd8ed1ab_0    conda-forge
astunparse                1.6.3              pyhd8ed1ab_0    conda-forge
async-lru                 2.0.4              pyhd8ed1ab_0    conda-forge
attrs                     23.2.0             pyh71513ae_0    conda-forge
aws-c-auth                0.7.11               h0b4cabd_1    conda-forge
aws-c-cal                 0.6.9                h14ec70c_3    conda-forge
aws-c-common              0.9.12               hd590300_0    conda-forge
aws-c-compression         0.2.17               h572eabf_8    conda-forge
aws-c-event-stream        0.4.1                h97bb272_2    conda-forge
aws-c-http                0.8.0                h9129f04_2    conda-forge
aws-c-io                  0.14.0               hf8f278a_1    conda-forge
aws-c-mqtt                0.10.1               h2b97f5f_0    conda-forge
aws-c-s3                  0.4.9                hca09fc5_0    conda-forge
aws-c-sdkutils            0.1.13               h572eabf_1    conda-forge
aws-checksums             0.1.17               h572eabf_7    conda-forge
aws-crt-cpp               0.26.0               h04327c0_8    conda-forge
aws-sdk-cpp               1.11.210            hba3e011_10    conda-forge
babel                     2.14.0             pyhd8ed1ab_0    conda-forge
beautifulsoup4            4.12.3             pyha770c72_0    conda-forge
bleach                    6.1.0              pyhd8ed1ab_0    conda-forge
blinker                   1.7.0              pyhd8ed1ab_0    conda-forge
blosc                     1.21.5               h0f2a231_0    conda-forge
bokeh                     3.3.4              pyhd8ed1ab_0    conda-forge
brotli                    1.1.0                hd590300_1    conda-forge
brotli-bin                1.1.0                hd590300_1    conda-forge
brotli-python             1.1.0           py311hb755f60_1    conda-forge
brunsli                   0.1                  h9c3ff4c_0    conda-forge
bzip2                     1.0.8                hd590300_5    conda-forge
c-ares                    1.27.0               hd590300_0    conda-forge
c-blosc2                  2.13.2               hb4ffafa_0    conda-forge
ca-certificates           2024.2.2             hbcca054_0    conda-forge
cached-property           1.5.2                hd8ed1ab_1    conda-forge
cached_property           1.5.2              pyha770c72_1    conda-forge
cachetools                5.3.3              pyhd8ed1ab_0    conda-forge
certifi                   2024.2.2           pyhd8ed1ab_0    conda-forge
cffi                      1.16.0          py311hb3a22ac_0    conda-forge
charls                    2.4.2                h59595ed_0    conda-forge
charset-normalizer        3.3.2              pyhd8ed1ab_0    conda-forge
click                     8.1.7           unix_pyh707e725_0    conda-forge
cloudpickle               3.0.0              pyhd8ed1ab_0    conda-forge
colorama                  0.4.6              pyhd8ed1ab_0    conda-forge
comm                      0.2.1              pyhd8ed1ab_0    conda-forge
contourpy                 1.2.0           py311h9547e67_0    conda-forge
cryptography              42.0.5          py311h63ff55d_0    conda-forge
csbdeep                   0.7.4           py311h38be061_1    conda-forge
cuda-version              11.8                 h70ddcb2_2    conda-forge
cudatoolkit               11.8.0              h4ba93d1_13    conda-forge
cudnn                     8.8.0.121            hcdd5f01_4    conda-forge
cycler                    0.12.1             pyhd8ed1ab_0    conda-forge
cytoolz                   0.12.3          py311h459d7ec_0    conda-forge
dask                      2024.2.1           pyhd8ed1ab_0    conda-forge
dask-core                 2024.2.1           pyhd8ed1ab_0    conda-forge
dask-image                2023.8.1           pyhd8ed1ab_0    conda-forge
dav1d                     1.2.1                hd590300_0    conda-forge
debugpy                   1.8.1           py311hb755f60_0    conda-forge
decorator                 5.1.1              pyhd8ed1ab_0    conda-forge
defusedxml                0.7.1              pyhd8ed1ab_0    conda-forge
distributed               2024.2.1           pyhd8ed1ab_0    conda-forge
docker-pycreds            0.4.0                      py_0    conda-forge
entrypoints               0.4                pyhd8ed1ab_0    conda-forge
exceptiongroup            1.2.0              pyhd8ed1ab_2    conda-forge
executing                 2.0.1              pyhd8ed1ab_0    conda-forge
fasteners                 0.17.3             pyhd8ed1ab_0    conda-forge
flatbuffers               23.5.26              h59595ed_1    conda-forge
fonttools                 4.49.0          py311h459d7ec_0    conda-forge
fqdn                      1.5.1              pyhd8ed1ab_0    conda-forge
freetype                  2.12.1               h267a509_2    conda-forge
frozenlist                1.4.1           py311h459d7ec_0    conda-forge
fsspec                    2024.2.0           pyhca7485f_0    conda-forge
gast                      0.5.4              pyhd8ed1ab_0    conda-forge
gflags                    2.2.2             he1b5a44_1004    conda-forge
giflib                    5.2.1                h0b41bf4_3    conda-forge
gitdb                     4.0.11             pyhd8ed1ab_0    conda-forge
gitpython                 3.1.42             pyhd8ed1ab_0    conda-forge
glog                      0.6.0                h6f12383_0    conda-forge
google-auth               2.28.1             pyhca7485f_0    conda-forge
google-auth-oauthlib      1.0.0              pyhd8ed1ab_1    conda-forge
google-pasta              0.2.0              pyh8c360ce_0    conda-forge
grpcio                    1.59.3          py311ha6695c7_0    conda-forge
h11                       0.14.0             pyhd8ed1ab_0    conda-forge
h2                        4.1.0              pyhd8ed1ab_0    conda-forge
h5py                      3.10.0          nompi_py311hebc2b07_101    conda-forge
hdf5                      1.14.3          nompi_h4f84152_100    conda-forge
hpack                     4.0.0              pyh9f0ad1d_0    conda-forge
httpcore                  1.0.4              pyhd8ed1ab_0    conda-forge
httpx                     0.27.0             pyhd8ed1ab_0    conda-forge
hyperframe                6.0.1              pyhd8ed1ab_0    conda-forge
icu                       73.2                 h59595ed_0    conda-forge
idna                      3.6                pyhd8ed1ab_0    conda-forge
imagecodecs               2024.1.1        py311h089f87a_0    conda-forge
imageio                   2.34.0             pyh4b66e23_0    conda-forge
importlib-metadata        7.0.1              pyha770c72_0    conda-forge
importlib_metadata        7.0.1                hd8ed1ab_0    conda-forge
importlib_resources       6.1.2              pyhd8ed1ab_0    conda-forge
ipykernel                 6.29.3             pyhd33586a_0    conda-forge
ipython                   8.22.1             pyh707e725_0    conda-forge
ipywidgets                8.1.2              pyhd8ed1ab_0    conda-forge
isoduration               20.11.0            pyhd8ed1ab_0    conda-forge
jedi                      0.19.1             pyhd8ed1ab_0    conda-forge
jinja2                    3.1.3              pyhd8ed1ab_0    conda-forge
json5                     0.9.20             pyhd8ed1ab_0    conda-forge
jsonpointer               2.4             py311h38be061_3    conda-forge
jsonschema                4.21.1             pyhd8ed1ab_0    conda-forge
jsonschema-specifications 2023.12.1          pyhd8ed1ab_0    conda-forge
jsonschema-with-format-nongpl 4.21.1             pyhd8ed1ab_0    conda-forge
jupyter                   1.0.0             pyhd8ed1ab_10    conda-forge
jupyter-lsp               2.2.3              pyhd8ed1ab_0    conda-forge
jupyter_client            8.6.0              pyhd8ed1ab_0    conda-forge
jupyter_console           6.6.3              pyhd8ed1ab_0    conda-forge
jupyter_core              5.7.1           py311h38be061_0    conda-forge
jupyter_events            0.9.0              pyhd8ed1ab_0    conda-forge
jupyter_server            2.12.5             pyhd8ed1ab_0    conda-forge
jupyter_server_terminals  0.5.2              pyhd8ed1ab_0    conda-forge
jupyterlab                4.1.2              pyhd8ed1ab_0    conda-forge
jupyterlab_pygments       0.3.0              pyhd8ed1ab_1    conda-forge
jupyterlab_server         2.25.3             pyhd8ed1ab_0    conda-forge
jupyterlab_widgets        3.0.10             pyhd8ed1ab_0    conda-forge
jxrlib                    1.1                  hd590300_3    conda-forge
keras                     2.15.0             pyhd8ed1ab_0    conda-forge
keyutils                  1.6.1                h166bdaf_0    conda-forge
kiwisolver                1.4.5           py311h9547e67_1    conda-forge
krb5                      1.21.2               h659d440_0    conda-forge
lazy_loader               0.3                pyhd8ed1ab_0    conda-forge
lcms2                     2.16                 hb7c19ff_0    conda-forge
ld_impl_linux-64          2.40                 h41732ed_0    conda-forge
lerc                      4.0.0                h27087fc_0    conda-forge
libabseil                 20230802.1      cxx17_h59595ed_0    conda-forge
libaec                    1.1.2                h59595ed_1    conda-forge
libarrow                  15.0.0           h84dd17c_0_cpu    conda-forge
libarrow-acero            15.0.0           h59595ed_0_cpu    conda-forge
libarrow-dataset          15.0.0           h59595ed_0_cpu    conda-forge
libarrow-flight           15.0.0           h120cb0d_0_cpu    conda-forge
libarrow-flight-sql       15.0.0           h61ff412_0_cpu    conda-forge
libarrow-gandiva          15.0.0           hacb8726_0_cpu    conda-forge
libarrow-substrait        15.0.0           h61ff412_0_cpu    conda-forge
libavif16                 1.0.4                h1dcd450_1    conda-forge
libblas                   3.9.0           21_linux64_openblas    conda-forge
libbrotlicommon           1.1.0                hd590300_1    conda-forge
libbrotlidec              1.1.0                hd590300_1    conda-forge
libbrotlienc              1.1.0                hd590300_1    conda-forge
libcblas                  3.9.0           21_linux64_openblas    conda-forge
libcrc32c                 1.1.2                h9c3ff4c_0    conda-forge
libcurl                   8.5.0                hca28451_0    conda-forge
libdeflate                1.19                 hd590300_0    conda-forge
libedit                   3.1.20191231         he28a2e2_2    conda-forge
libev                     4.33                 hd590300_2    conda-forge
libevent                  2.1.12               hf998b51_1    conda-forge
libexpat                  2.5.0                hcb278e6_1    conda-forge
libffi                    3.4.2                h7f98852_5    conda-forge
libgcc-ng                 13.2.0               h807b86a_5    conda-forge
libgfortran-ng            13.2.0               h69a702a_5    conda-forge
libgfortran5              13.2.0               ha4646dd_5    conda-forge
libgomp                   13.2.0               h807b86a_5    conda-forge
libgoogle-cloud           2.12.0               h5206363_4    conda-forge
libgrpc                   1.59.3               hd6c4280_0    conda-forge
libiconv                  1.17                 hd590300_2    conda-forge
libjpeg-turbo             3.0.0                hd590300_1    conda-forge
liblapack                 3.9.0           21_linux64_openblas    conda-forge
libllvm14                 14.0.6               hcd5def8_4    conda-forge
libllvm15                 15.0.7               hb3ce162_4    conda-forge
libnghttp2                1.58.0               h47da74e_1    conda-forge
libnl                     3.9.0                hd590300_0    conda-forge
libnsl                    2.0.1                hd590300_0    conda-forge
libnuma                   2.0.16               h0b41bf4_1    conda-forge
libopenblas               0.3.26          pthreads_h413a1c8_0    conda-forge
libparquet                15.0.0           h352af49_0_cpu    conda-forge
libpng                    1.6.43               h2797004_0    conda-forge
libprotobuf               4.24.4               hf27288f_0    conda-forge
libre2-11                 2023.09.01           h7a70373_1    conda-forge
libsodium                 1.0.18               h36c2ea0_1    conda-forge
libsqlite                 3.45.1               h2797004_0    conda-forge
libssh2                   1.11.0               h0841786_0    conda-forge
libstdcxx-ng              13.2.0               h7e041cc_5    conda-forge
libthrift                 0.19.0               hb90f79a_1    conda-forge
libtiff                   4.6.0                ha9c0a0a_2    conda-forge
libutf8proc               2.8.0                h166bdaf_0    conda-forge
libuuid                   2.38.1               h0b41bf4_0    conda-forge
libwebp-base              1.3.2                hd590300_0    conda-forge
libxcb                    1.15                 h0b41bf4_0    conda-forge
libxcrypt                 4.4.36               hd590300_1    conda-forge
libxml2                   2.12.5               h232c23b_0    conda-forge
libzlib                   1.2.13               hd590300_5    conda-forge
libzopfli                 1.0.3                h9c3ff4c_0    conda-forge
llvmlite                  0.42.0          py311ha6695c7_1    conda-forge
locket                    1.0.0              pyhd8ed1ab_0    conda-forge
lz4                       4.3.3           py311h38e4bf4_0    conda-forge
lz4-c                     1.9.4                hcb278e6_0    conda-forge
markdown                  3.5.2              pyhd8ed1ab_0    conda-forge
markupsafe                2.1.5           py311h459d7ec_0    conda-forge
matplotlib-base           3.8.3           py311h54ef318_0    conda-forge
matplotlib-inline         0.1.6              pyhd8ed1ab_0    conda-forge
mistune                   3.0.2              pyhd8ed1ab_0    conda-forge
ml_dtypes                 0.2.0           py311h320fe9a_2    conda-forge
msgpack-python            1.0.7           py311h9547e67_0    conda-forge
multidict                 6.0.5           py311h459d7ec_0    conda-forge
munkres                   1.1.4              pyh9f0ad1d_0    conda-forge
nbclient                  0.8.0              pyhd8ed1ab_0    conda-forge
nbconvert                 7.16.1             pyhd8ed1ab_0    conda-forge
nbconvert-core            7.16.1             pyhd8ed1ab_0    conda-forge
nbconvert-pandoc          7.16.1             pyhd8ed1ab_0    conda-forge
nbformat                  5.9.2              pyhd8ed1ab_0    conda-forge
nccl                      2.20.3.1             h6103f9b_0    conda-forge
ncurses                   6.4                  h59595ed_2    conda-forge
nest-asyncio              1.6.0              pyhd8ed1ab_0    conda-forge
networkx                  3.2.1              pyhd8ed1ab_0    conda-forge
notebook                  7.1.1              pyhd8ed1ab_0    conda-forge
notebook-shim             0.2.4              pyhd8ed1ab_0    conda-forge
numba                     0.59.0          py311h96b013e_1    conda-forge
numcodecs                 0.12.1          py311hb755f60_0    conda-forge
numpy                     1.26.4          py311h64a7726_0    conda-forge
oauthlib                  3.2.2              pyhd8ed1ab_0    conda-forge
ome-zarr                  0.8.3              pyhd8ed1ab_0    conda-forge
openjpeg                  2.5.2                h488ebb8_0    conda-forge
openssl                   3.2.1                hd590300_0    conda-forge
opt_einsum                3.3.0              pyhc1e730c_2    conda-forge
orc                       1.9.2                h4b38347_0    conda-forge
overrides                 7.7.0              pyhd8ed1ab_0    conda-forge
packaging                 23.2               pyhd8ed1ab_0    conda-forge
pandas                    2.2.1           py311h320fe9a_0    conda-forge
pandoc                    3.1.12.2             ha770c72_0    conda-forge
pandocfilters             1.5.0              pyhd8ed1ab_0    conda-forge
parso                     0.8.3              pyhd8ed1ab_0    conda-forge
partd                     1.4.1              pyhd8ed1ab_0    conda-forge
pathtools                 0.1.2                      py_1    conda-forge
pexpect                   4.9.0              pyhd8ed1ab_0    conda-forge
pickleshare               0.7.5                   py_1003    conda-forge
pillow                    10.2.0          py311ha6c5da5_0    conda-forge
pims                      0.6.1              pyhd8ed1ab_1    conda-forge
pip                       24.0               pyhd8ed1ab_0    conda-forge
pkgutil-resolve-name      1.3.10             pyhd8ed1ab_1    conda-forge
platformdirs              4.2.0              pyhd8ed1ab_0    conda-forge
prometheus_client         0.20.0             pyhd8ed1ab_0    conda-forge
prompt-toolkit            3.0.42             pyha770c72_0    conda-forge
prompt_toolkit            3.0.42               hd8ed1ab_0    conda-forge
protobuf                  4.24.4          py311h46cbc50_0    conda-forge
psutil                    5.9.8           py311h459d7ec_0    conda-forge
pthread-stubs             0.4               h36c2ea0_1001    conda-forge
ptyprocess                0.7.0              pyhd3deb0d_0    conda-forge
pure_eval                 0.2.2              pyhd8ed1ab_0    conda-forge
pyarrow                   15.0.0          py311h39c9aba_0_cpu    conda-forge
pyarrow-hotfix            0.6                pyhd8ed1ab_0    conda-forge
pyasn1                    0.5.1              pyhd8ed1ab_0    conda-forge
pyasn1-modules            0.3.0              pyhd8ed1ab_0    conda-forge
pycparser                 2.21               pyhd8ed1ab_0    conda-forge
pydantic                  1.10.13         py311h459d7ec_1    conda-forge
pygments                  2.17.2             pyhd8ed1ab_0    conda-forge
pyjwt                     2.8.0              pyhd8ed1ab_1    conda-forge
pyopenssl                 24.0.0             pyhd8ed1ab_0    conda-forge
pyparsing                 3.1.1              pyhd8ed1ab_0    conda-forge
pysocks                   1.7.1              pyha2e5f31_6    conda-forge
python                    3.11.8          hab00c5b_0_cpython    conda-forge
python-dateutil           2.9.0              pyhd8ed1ab_0    conda-forge
python-fastjsonschema     2.19.1             pyhd8ed1ab_0    conda-forge
python-flatbuffers        23.5.26            pyhd8ed1ab_0    conda-forge
python-json-logger        2.0.7              pyhd8ed1ab_0    conda-forge
python-tzdata             2024.1             pyhd8ed1ab_0    conda-forge
python_abi                3.11                    4_cp311    conda-forge
pytz                      2024.1             pyhd8ed1ab_0    conda-forge
pyu2f                     0.1.5              pyhd8ed1ab_0    conda-forge
pywavelets                1.4.1           py311h1f0f07a_1    conda-forge
pyyaml                    6.0.1           py311h459d7ec_1    conda-forge
pyzmq                     25.1.2          py311h34ded2d_0    conda-forge
qtconsole-base            5.5.1              pyha770c72_0    conda-forge
qtpy                      2.4.1              pyhd8ed1ab_0    conda-forge
rav1e                     0.6.6                he8a937b_2    conda-forge
rdma-core                 50.0                 hd3aeb46_0    conda-forge
re2                       2023.09.01           h7f4b329_1    conda-forge
readline                  8.2                  h8228510_1    conda-forge
referencing               0.33.0             pyhd8ed1ab_0    conda-forge
requests                  2.31.0             pyhd8ed1ab_0    conda-forge
requests-oauthlib         1.3.1              pyhd8ed1ab_0    conda-forge
rfc3339-validator         0.1.4              pyhd8ed1ab_0    conda-forge
rfc3986-validator         0.1.1              pyh9f0ad1d_0    conda-forge
rpds-py                   0.18.0          py311h46250e7_0    conda-forge
rsa                       4.9                pyhd8ed1ab_0    conda-forge
run-stardist              0.0.2                    pypy_1    qin-yu
s2n                       1.4.1                h06160fa_0    conda-forge
scikit-image              0.22.0          py311h320fe9a_2    conda-forge
scipy                     1.12.0          py311h64a7726_2    conda-forge
send2trash                1.8.2              pyh41d4057_0    conda-forge
sentry-sdk                1.40.6             pyhd8ed1ab_0    conda-forge
setproctitle              1.3.3           py311h459d7ec_0    conda-forge
setuptools                69.1.1             pyhd8ed1ab_0    conda-forge
six                       1.16.0             pyh6c4a22f_0    conda-forge
slicerator                1.1.0              pyhd8ed1ab_0    conda-forge
smmap                     5.0.0              pyhd8ed1ab_0    conda-forge
snappy                    1.1.10               h9fff704_0    conda-forge
sniffio                   1.3.1              pyhd8ed1ab_0    conda-forge
sortedcontainers          2.4.0              pyhd8ed1ab_0    conda-forge
soupsieve                 2.5                pyhd8ed1ab_1    conda-forge
stack_data                0.6.2              pyhd8ed1ab_0    conda-forge
stardist                  0.8.5           py311h320fe9a_1    conda-forge
svt-av1                   1.8.0                h59595ed_0    conda-forge
tblib                     3.0.0              pyhd8ed1ab_0    conda-forge
tensorboard               2.15.2             pyhd8ed1ab_0    conda-forge
tensorboard-data-server   0.7.0           py311h63ff55d_1    conda-forge
tensorflow                2.15.0          cpu_py311hd3d7757_2    conda-forge
tensorflow-base           2.15.0          cpu_py311h6aa969b_2    conda-forge
tensorflow-estimator      2.15.0          cpu_py311ha26c8b9_2    conda-forge
termcolor                 2.4.0              pyhd8ed1ab_0    conda-forge
terminado                 0.18.0             pyh0d859eb_0    conda-forge
tifffile                  2024.2.12          pyhd8ed1ab_0    conda-forge
tinycss2                  1.2.1              pyhd8ed1ab_0    conda-forge
tk                        8.6.13          noxft_h4845f30_101    conda-forge
tomli                     2.0.1              pyhd8ed1ab_0    conda-forge
toolz                     0.12.1             pyhd8ed1ab_0    conda-forge
tornado                   6.4             py311h459d7ec_0    conda-forge
tqdm                      4.66.2             pyhd8ed1ab_0    conda-forge
traitlets                 5.14.1             pyhd8ed1ab_0    conda-forge
types-python-dateutil     2.8.19.20240106    pyhd8ed1ab_0    conda-forge
typing-extensions         4.10.0               hd8ed1ab_0    conda-forge
typing_extensions         4.10.0             pyha770c72_0    conda-forge
typing_utils              0.1.0              pyhd8ed1ab_0    conda-forge
tzdata                    2024a                h0c530f3_0    conda-forge
ucx                       1.15.0               h75e419f_3    conda-forge
uri-template              1.3.0              pyhd8ed1ab_0    conda-forge
urllib3                   2.2.1              pyhd8ed1ab_0    conda-forge
wandb                     0.16.3             pyhd8ed1ab_0    conda-forge
wcwidth                   0.2.13             pyhd8ed1ab_0    conda-forge
webcolors                 1.13               pyhd8ed1ab_0    conda-forge
webencodings              0.5.1              pyhd8ed1ab_2    conda-forge
websocket-client          1.7.0              pyhd8ed1ab_0    conda-forge
werkzeug                  3.0.1              pyhd8ed1ab_0    conda-forge
wheel                     0.42.0             pyhd8ed1ab_0    conda-forge
widgetsnbextension        4.0.10             pyhd8ed1ab_0    conda-forge
wrapt                     1.14.1          py311hd4cff14_1    conda-forge
xorg-libxau               1.0.11               hd590300_0    conda-forge
xorg-libxdmcp             1.1.3                h7f98852_0    conda-forge
xyzservices               2023.10.1          pyhd8ed1ab_0    conda-forge
xz                        5.2.6                h166bdaf_0    conda-forge
yaml                      0.2.5                h7f98852_2    conda-forge
yarl                      1.9.4           py311h459d7ec_0    conda-forge
zarr                      2.17.0             pyhd8ed1ab_0    conda-forge
zeromq                    4.3.5                h59595ed_1    conda-forge
zfp                       1.0.1                h59595ed_0    conda-forge
zict                      3.0.0              pyhd8ed1ab_0    conda-forge
zipp                      3.17.0             pyhd8ed1ab_0    conda-forge
zlib                      1.2.13               hd590300_5    conda-forge
zlib-ng                   2.0.7                h0b41bf4_0    conda-forge
zstd                      1.5.5                hfc55251_0    conda-forge
@m-albert
Copy link
Collaborator

m-albert commented Mar 8, 2024

Thanks for reporting this @tibuch 🙏

Thanks to your detailed report I could reproduce:

!pip install pyarrow
import dask.array as da
from dask_image import ndmeasure

bbox_df = ndmeasure.find_objects(da.ones((10, 10), chunks=(5,5), dtype='int')).compute()

Turns out we had come across this issue before and weren't sure whether it's still present (as it currently escapes our CI tests, for more details see here). It's related to a recent change in dask and occurs in the presence of pyarrow in the environment. pyarrow is installed together with the conda distribution of dask and not with the pip distribution.

Until the problem is fixed, there's the following workaround:

with dask.config.set({"dataframe.convert-string": False}):
    bbox_df = ndmeasure.find_objects(da.ones((10, 10), chunks=(5,5), dtype='int')).compute()

@jakirkham
Copy link
Member

Am no longer able to reproduce this issue. Are others still able to?

  • If so, can you please share how?
  • If not, maybe we can close

@tibuch
Copy link
Author

tibuch commented May 23, 2024

Works for me with the latest versions 👍

@tibuch tibuch closed this as completed May 23, 2024
@jakirkham
Copy link
Member

Thanks Tim-Oliver! 🙏

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

3 participants