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

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

Open
VerbeekM opened this issue Mar 26, 2024 · 2 comments
Open
Labels
bug Something isn't working

Comments

@VerbeekM
Copy link

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 VerbeekM added the bug Something isn't working label Mar 26, 2024
@VerbeekM VerbeekM changed the title tributeError: 'CellposeModel' object has no attribute 'diam_labels'[BUG] AttributeError: 'CellposeModel' object has no attribute 'diam_labels'[BUG] Mar 26, 2024
@tanpancodes
Copy link

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

@XylotrupesGideon
Copy link

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)

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

3 participants