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

[BUG] error when --diameter is set to 0. #1072

Open
jazberna1 opened this issue Dec 4, 2024 · 0 comments
Open

[BUG] error when --diameter is set to 0. #1072

jazberna1 opened this issue Dec 4, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@jazberna1
Copy link

Describe the bug
Hi, I get error when I run cellpose on the CLI setting --diameter 0. so the diameter gets estimated. I don't get the error when I supply a value for the diameter.

To Reproduce
This is the commad I am running

python -m cellpose --Zstack --verbose
--diameter 0.
--image_path /jorge/outdir/image.tif
--use_gpu
--savedir /jorge/outdir
--save_tif
--no_npy
--pretrained_model nuclei

My versions and OS:
cellpose version: 3.1.0
platform: win32
python version: 3.10.15
torch version: 2.5.1+cu118

Run log
This is the full traceback

Traceback (most recent call last):
  File "C:\Users\malieva\miniconda3\envs\cellpose\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\malieva\miniconda3\envs\cellpose\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Users\malieva\miniconda3\envs\cellpose\lib\site-packages\cellpose\__main__.py", line 358, in <module>
    main()
  File "C:\Users\malieva\miniconda3\envs\cellpose\lib\site-packages\cellpose\__main__.py", line 205, in main
    out = model.eval(
  File "C:\Users\malieva\miniconda3\envs\cellpose\lib\site-packages\cellpose\models.py", line 187, in eval
    diams, _ = self.sz.eval(x, channels=channels, channel_axis=channel_axis,
  File "C:\Users\malieva\miniconda3\envs\cellpose\lib\site-packages\cellpose\models.py", line 773, in eval
    diam_style = self.diam_mean if (diam_style == 0 or
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
@jazberna1 jazberna1 added the bug Something isn't working label Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant