cellpose icon indicating copy to clipboard operation
cellpose copied to clipboard

BUG in drawing the areas

Open Anto9393 opened this issue 1 year ago • 10 comments

Hi,

I am trying to retrain a model and when I correct the mask as It IS explained in the tutorial video there is a point where I acnot correct anymore the mask and It start appearing points where I go with the pc mice.

In the conda prompt i have this result for each points.

QGraphicsScene::removeItem: item 0x2975b49cf80's scene (0x0) is different from this scene (0x2975de98860)

Anyone can help me???

Thanks

Anto9393 avatar Jun 17 '24 23:06 Anto9393

Dear Cellpose team, we are also encountering this same problem in the cellpose3 version. Are there any updates on this issue?

In brief, what we have experienced: While correcting manually a 2D mask by re-drawing labels, it often occurs that the starting-point of a newly started label disappears (red dot), and the label cannot be closed. So it keeps drawing the label and nothing can be done. The only way we found to exit the situation is to close cellpose and re-start it.

It would be great to get hints or help on this!

Thanks

camcaminin9 avatar Aug 14 '24 14:08 camcaminin9

Hi I have been facing the same issue and would be very grateful for any help or suggestions.

Thank you.

diksh91 avatar Aug 19 '24 17:08 diksh91

Hi, we are also experiencing the same problem. It sometimes gets so bad that it's not even possible to draw one label. Any help or suggestions would be really appreciated. Thanks!

laura-rus avatar Aug 20 '24 11:08 laura-rus

Can you please share your OS and pip list? I know this happens on Mac but cannot replicate on other OS's

carsen-stringer avatar Aug 20 '24 11:08 carsen-stringer

We are using LINUX, in the screenshot is the error message we get, and here below is the pip list Screenshot 2024-08-20 at 15 47 26

Package                  Version
------------------------ ---------
Brotli                   1.1.0
cachetools               5.3.3
cellpose                 3.0.7
certifi                  2024.2.2
charset-normalizer       3.3.2
fastremap                1.14.1
filelock                 3.13.1
fsspec                   2024.3.1
gmpy2                    2.1.2
google-api-core          2.18.0
google-auth              2.29.0
google-cloud-core        2.4.1
google-cloud-storage     2.16.0
google-crc32c            1.5.0
google-resumable-media   2.7.0
googleapis-common-protos 1.63.0
idna                     3.6
imagecodecs              2023.3.16
importlib_metadata       7.1.0
Jinja2                   3.1.3
llvmlite                 0.41.1
MarkupSafe               2.1.5
mpmath                   1.3.0
natsort                  8.4.0
networkx                 3.1
numba                    0.58.1
numpy                    1.24.4
opencv-python-headless   4.9.0.80
packaging                24.0
Pillow                   9.4.0
pip                      24.0
proto-plus               1.23.0
protobuf                 4.25.3
pyasn1                   0.5.1
pyasn1-modules           0.3.0
Pygments                 2.17.2
PyQt6                    6.6.1
PyQt6-Qt6                6.6.2
PyQt6-sip                13.6.0
pyqtgraph                0.13.3
PySocks                  1.7.1
PyYAML                   6.0.1
QtPy                     2.4.1
requests                 2.31.0
roifile                  2023.5.12
rsa                      4.9
scipy                    1.10.1
setuptools               69.2.0
superqt                  0.6.2
sympy                    1.12
tifffile                 2023.7.10
torch                    2.2.1
torchaudio               2.2.1
torchvision              0.17.1
tqdm                     4.66.2
triton                   2.2.0
typing_extensions        4.10.0
urllib3                  2.2.1
wheel                    0.43.0
zipp                     3.18.1

camcaminin9 avatar Aug 20 '24 14:08 camcaminin9

thanks can you please post your "conda list" as well? I can't reproduce this on windows and linux with the latest pyqt6 and pyqtgraph, and python=3.10 or python=3.11.

carsen-stringer avatar Aug 23 '24 13:08 carsen-stringer

Thanks for answering, here is the conda list:

(cellpose3) akhan@jupyter-akhan:/home/akhan$ conda list
# packages in environment at /g/cba/miniconda3/envs/cellpose3:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                 conda_forge    conda-forge
_openmp_mutex             4.5                  2_kmp_llvm    conda-forge
blas                      2.116                       mkl    conda-forge
blas-devel                3.9.0            16_linux64_mkl    conda-forge
brotli-python             1.1.0            py38h17151c0_1    conda-forge
bzip2                     1.0.8                hd590300_5    conda-forge
ca-certificates           2024.2.2             hbcca054_0    conda-forge
cachetools                5.3.3                    pypi_0    pypi
cellpose                  3.0.7                    pypi_0    pypi
certifi                   2024.2.2           pyhd8ed1ab_0    conda-forge
charset-normalizer        3.3.2              pyhd8ed1ab_0    conda-forge
cuda-cudart               11.8.89                       0    nvidia
cuda-cupti                11.8.87                       0    nvidia
cuda-libraries            11.8.0                        0    nvidia
cuda-nvrtc                11.8.89                       0    nvidia
cuda-nvtx                 11.8.86                       0    nvidia
cuda-runtime              11.8.0                        0    nvidia
fastremap                 1.14.1                   pypi_0    pypi
ffmpeg                    4.3                  hf484d3e_0    pytorch
filelock                  3.13.1             pyhd8ed1ab_0    conda-forge
freetype                  2.12.1               h267a509_2    conda-forge
fsspec                    2024.3.1                 pypi_0    pypi
gmp                       6.3.0                h59595ed_1    conda-forge
gmpy2                     2.1.2            py38h793c122_1    conda-forge
gnutls                    3.6.13               h85f3911_1    conda-forge
google-api-core           2.18.0                   pypi_0    pypi
google-auth               2.29.0                   pypi_0    pypi
google-cloud-core         2.4.1                    pypi_0    pypi
google-cloud-storage      2.16.0                   pypi_0    pypi
google-crc32c             1.5.0                    pypi_0    pypi
google-resumable-media    2.7.0                    pypi_0    pypi
googleapis-common-protos  1.63.0                   pypi_0    pypi
icu                       73.2                 h59595ed_0    conda-forge
idna                      3.6                pyhd8ed1ab_0    conda-forge
imagecodecs               2023.3.16                pypi_0    pypi
importlib-metadata        7.1.0                    pypi_0    pypi
jinja2                    3.1.3              pyhd8ed1ab_0    conda-forge
jpeg                      9e                   h166bdaf_2    conda-forge
lame                      3.100             h166bdaf_1003    conda-forge
lcms2                     2.15                 hfd0df8a_0    conda-forge
ld_impl_linux-64          2.40                 h41732ed_0    conda-forge
lerc                      4.0.0                h27087fc_0    conda-forge
libblas                   3.9.0            16_linux64_mkl    conda-forge
libcblas                  3.9.0            16_linux64_mkl    conda-forge
libcublas                 11.11.3.6                     0    nvidia
libcufft                  10.9.0.58                     0    nvidia
libcufile                 1.9.0.20                      0    nvidia
libcurand                 10.3.5.119                    0    nvidia
libcusolver               11.4.1.48                     0    nvidia
libcusparse               11.7.5.86                     0    nvidia
libdeflate                1.17                 h0b41bf4_0    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
libhwloc                  2.9.3           default_h554bfaf_1009    conda-forge
libiconv                  1.17                 hd590300_2    conda-forge
libjpeg-turbo             2.0.0                h9bf148f_0    pytorch
liblapack                 3.9.0            16_linux64_mkl    conda-forge
liblapacke                3.9.0            16_linux64_mkl    conda-forge
libnpp                    11.8.0.86                     0    nvidia
libnsl                    2.0.1                hd590300_0    conda-forge
libnvjpeg                 11.9.0.86                     0    nvidia
libpng                    1.6.43               h2797004_0    conda-forge
libsqlite                 3.45.2               h2797004_0    conda-forge
libstdcxx-ng              13.2.0               h7e041cc_5    conda-forge
libtiff                   4.5.0                h6adf6a1_2    conda-forge
libuuid                   2.38.1               h0b41bf4_0    conda-forge
libwebp-base              1.3.2                hd590300_0    conda-forge
libxcb                    1.13              h7f98852_1004    conda-forge
libxcrypt                 4.4.36               hd590300_1    conda-forge
libxml2                   2.12.6               h232c23b_0    conda-forge
libzlib                   1.2.13               hd590300_5    conda-forge
llvm-openmp               15.0.7               h0cdce71_0    conda-forge
llvmlite                  0.41.1                   pypi_0    pypi
markupsafe                2.1.5            py38h01eb140_0    conda-forge
mkl                       2022.1.0           h84fe81f_915    conda-forge
mkl-devel                 2022.1.0           ha770c72_916    conda-forge
mkl-include               2022.1.0           h84fe81f_915    conda-forge
mpc                       1.3.1                hfe3b2da_0    conda-forge
mpfr                      4.2.1                h9458935_0    conda-forge
mpmath                    1.3.0              pyhd8ed1ab_0    conda-forge
natsort                   8.4.0                    pypi_0    pypi
ncurses                   6.4.20240210         h59595ed_0    conda-forge
nettle                    3.6                  he412f7d_0    conda-forge
networkx                  3.1                pyhd8ed1ab_0    conda-forge
numba                     0.58.1                   pypi_0    pypi
numpy                     1.24.4           py38h59b608b_0    conda-forge
opencv-python-headless    4.9.0.80                 pypi_0    pypi
openh264                  2.1.1                h780b84a_0    conda-forge
openjpeg                  2.5.0                hfec8fc6_2    conda-forge
openssl                   3.2.1                hd590300_1    conda-forge
packaging                 24.0                     pypi_0    pypi
pillow                    9.4.0            py38hde6dc18_1    conda-forge
pip                       24.0               pyhd8ed1ab_0    conda-forge
proto-plus                1.23.0                   pypi_0    pypi
protobuf                  4.25.3                   pypi_0    pypi
pthread-stubs             0.4               h36c2ea0_1001    conda-forge
pyasn1                    0.5.1                    pypi_0    pypi
pyasn1-modules            0.3.0                    pypi_0    pypi
pygments                  2.17.2                   pypi_0    pypi
pyqt6                     6.6.1                    pypi_0    pypi
pyqt6-qt6                 6.6.2                    pypi_0    pypi
pyqt6-sip                 13.6.0                   pypi_0    pypi
pyqtgraph                 0.13.3                   pypi_0    pypi
pysocks                   1.7.1              pyha2e5f31_6    conda-forge
python                    3.8.19          hd12c33a_0_cpython    conda-forge
python_abi                3.8                      4_cp38    conda-forge
pytorch                   2.2.1           py3.8_cuda11.8_cudnn8.7.0_0    pytorch
pytorch-cuda              11.8                 h7e8668a_5    pytorch
pytorch-mutex             1.0                        cuda    pytorch
pyyaml                    6.0.1            py38h01eb140_1    conda-forge
qtpy                      2.4.1                    pypi_0    pypi
readline                  8.2                  h8228510_1    conda-forge
requests                  2.31.0             pyhd8ed1ab_0    conda-forge
roifile                   2023.5.12                pypi_0    pypi
rsa                       4.9                      pypi_0    pypi
scipy                     1.10.1                   pypi_0    pypi
setuptools                69.2.0             pyhd8ed1ab_0    conda-forge
superqt                   0.6.2                    pypi_0    pypi
sympy                     1.12            pypyh9d50eac_103    conda-forge
tbb                       2021.11.0            h00ab1b0_1    conda-forge
tifffile                  2023.7.10                pypi_0    pypi
tk                        8.6.13          noxft_h4845f30_101    conda-forge
torchaudio                2.2.1                py38_cu118    pytorch
torchtriton               2.2.0                      py38    pytorch
torchvision               0.17.1               py38_cu118    pytorch
tqdm                      4.66.2                   pypi_0    pypi
typing_extensions         4.10.0             pyha770c72_0    conda-forge
urllib3                   2.2.1              pyhd8ed1ab_0    conda-forge
wheel                     0.43.0             pyhd8ed1ab_0    conda-forge
xorg-libxau               1.0.11               hd590300_0    conda-forge
xorg-libxdmcp             1.1.3                h7f98852_0    conda-forge
xz                        5.2.6                h166bdaf_0    conda-forge
yaml                      0.2.5                h7f98852_2    conda-forge
zipp                      3.18.1                   pypi_0    pypi
zlib                      1.2.13               hd590300_5    conda-forge
zstd                      1.5.5                hfc55251_0    conda-forge

camcaminin9 avatar Sep 02 '24 14:09 camcaminin9

Thanks can you please see if this bug also happens in Python 3.9 or 3.10? We may need to deprecate 3.8, also update to the latest pyqt6 and pyqtgraph

carsen-stringer avatar Sep 02 '24 14:09 carsen-stringer

another issue #997 , can you please try a later python version and the latest pyqt6 and pyqtgraph (pip install pyqt6 --upgrade ; pip install pyqtgraph --upgrade)

carsen-stringer avatar Sep 09 '24 05:09 carsen-stringer

This is also happening to me in fresh enviroments with python versions of 3.8, 3.10 and 3.11

JamesWGrimshaw avatar Sep 13 '24 17:09 JamesWGrimshaw

So that I can replicate your environment, please use this command and upload the yml: conda env export > environment.yml

Please do this in 3.10, is this in Windows or Linux?

carsen-stringer avatar Oct 25 '24 09:10 carsen-stringer

This is on windows (seen issue in both windows 10 and windows server 2022). I've also included an image and seg.npy which for me will fairly consistently produce the bug when one or two new labels are added.

Cellpose310_Issues.zip

JamesWGrimshaw avatar Oct 25 '24 10:10 JamesWGrimshaw

thank you @JamesWGrimshaw and @mayishazn for all the info about this bug, I was able to track it down, due to a squeeze of an axis that was causing an error but it was not printing any error. Also I was renumbering the masks and outlines during loading, and that could be inconsistent, so that is also now fixed (and the outlines will be recomputed for 2D images from seg files).

I can no longer reproduce the bug, but please let me know if you are still having issues.

install latest: pip install git+https://github.com/mouseland/cellpose.git

carsen-stringer avatar Oct 26 '24 15:10 carsen-stringer

I created a new environment and did a fresh install. The red circle does disappear once I close the loop but it doesn't turn into a mask. I've drawn four here and they're just stuck with the purple dotted lines. There is no drawing related output in the terminal either.

image

mayishazn avatar Nov 05 '24 06:11 mayishazn

@carsen-stringer I'm experiencing this issue with the latest version of cellpose. I created a fresh conda env with python 3.11 then only installed cellpose with pip install cellpose[gui]. Then after opening the GUI with cellpose --Zstack and checking the box for "single stroke", it will work for drawing maybe a few tens of cells then it seemingly randomly bugs out and won't let me close my shape any longer and I get repeated lines of this error message as I move the cursor:

QGraphicsScene::removeItem: item 0xd147550's scene (0x0) is different from this scene (0xc2625c0)

I've also tried updating to the latest dev release (3.1.1.2.dev7+g549126d) and downgrading to 2.3.2 and encountered the same problem. Downgrading to 2.2.3 seems to have solved it though.

nickeener avatar Feb 24 '25 01:02 nickeener