CellProfiler-plugins icon indicating copy to clipboard operation
CellProfiler-plugins copied to clipboard

CellPose plugin error

Open MikeLippincott opened this issue 1 year ago • 2 comments

After trying to run the runcellpose module I get the following error:

 File "/path/to/conda/env/lib/python3.8/site-packages/cellprofiler/gui/pipelinecontroller.py", line 3390, in do_step
    self.__pipeline.run_module(module, workspace_model)
  File "/path/to/conda/env/lib/python3.8/site-packages/cellprofiler_core/pipeline/_pipeline.py", line 1349, in run_module
    module.run(workspace)
  File "/path/to/CP.plugins/CellProfiler-plugins/active_plugins/runcellpose.py", line 612, in run
    if self.use_gpu.value and model.torch:
AttributeError: 'CellposeModel' object has no attribute 'torch'

I had to change line 567 of runcellpose.py to

if self.use_gpu.value and model.gpu:

and line 612 of runcellpose.py to

if self.use_gpu.value and model.gpu:

I can open a PR to fix these.

I will also open an issue on the CellPose repo requesting less drastic API changes in minor version changes or no version changes.

MikeLippincott avatar Dec 06 '24 15:12 MikeLippincott

Note: these changes would be for newer versions of CellPose > 3.1.0

MikeLippincott avatar Dec 06 '24 15:12 MikeLippincott

So did you make that working?

jamila-griffith avatar Jan 06 '25 01:01 jamila-griffith

Thanks @MikeLippincott for the suggested workaround. In dc49fe3 I took out the and model.torch so that we don't have to distinguish between minor versions of Cellpose. This will be merged in with #276

ErinWeisbart avatar Jul 30 '25 16:07 ErinWeisbart

Thanks @MikeLippincott for the suggested workaround. In dc49fe3 I took out the and model.torch so that we don't have to distinguish between minor versions of Cellpose. This will be merged in with #276

@ErinWeisbart et al. on this work: This is amazing! Thank you for your time and energy! :)

MikeLippincott avatar Jul 31 '25 02:07 MikeLippincott