cellpose icon indicating copy to clipboard operation
cellpose copied to clipboard

AttributeError: 'CellposeModel' object has no attribute 'diam_labels'[BUG]

Open VerbeekM opened this issue 10 months ago • 2 comments

I am training a model using the GUI. When I train the model using my annotated set of images with nuclei as an initial model all is well. However, when I swap the initial model for the scratch model I get the following error without changing the input images. I am using cellpose 3.

LOG: 2024-03-26 17:34:59,427 [INFO] 90, train_loss=0.0459, test_loss=0.0000, LR=0.1000, time 72.43s Traceback (most recent call last): File "/.conda/envs/cellposeyml/lib/python3.12/site-packages/cellpose/gui/gui.py", line 1958, in new_model self.train_model(restore=restore, normalize_params=normalize_params) File "/.conda/envs/cellposeyml/lib/python3.12/site-packages/cellpose/gui/gui.py", line 1992, in train_model diam_labels = self.model.diam_labels #.copy() ^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'CellposeModel' object has no attribute 'diam_labels'

Any idea how I could solve this? Thank you!

VerbeekM avatar Mar 26 '24 17:03 VerbeekM

I had a similar issue before... can you send a picture of the code you used//commands you executed (more log info)

tanpancodes avatar Apr 11 '24 20:04 tanpancodes

I ran into the same issue when I forgot to use the keyword pretrained_model in cellpose_models_CellposeModel

it occured when i did: cellpose.models.CellposeModel(cp_pretrained_model) instread of cellpose.models.CellposeModel(pretrained_model = cp_pretrained_model)

XylotrupesGideon avatar May 10 '24 15:05 XylotrupesGideon

I think this shouldn't be an issue in Cellpose3 but please let us know if you're still having issues

carsen-stringer avatar Sep 11 '24 07:09 carsen-stringer