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] Cellfinder issues with self-trained model #477

Open
Eddymorphling opened this issue Jan 21, 2025 · 4 comments
Open

[BUG] Cellfinder issues with self-trained model #477

Eddymorphling opened this issue Jan 21, 2025 · 4 comments
Labels
bug Something isn't working

Comments

@Eddymorphling
Copy link

Hi folks,
I am using a self trained Cellfinder model and brainmapper CLI to run registration and cell detection. Both registration and cell detections works well but the cell - classification step gives me an error. I get the error mentioned below. Not sure how to solve the issue. Just an FYI my self-trained model gets saved as "model.keras" not sure if this is the issue. Any suggestions? The brainmapper CLI that I am running is below. Thank you

Brainmapper CLI -

brainmapper -s $signal_folder -b $background_folder --trained-model $trained_model -o $output_folder_parent -v 7 2.7 2.7 --orientation sal --soma-spread-factor 1.4 --threshold 8 --soma-diameter 15 --atlas perens_lsfm_mouse_20um --ball-xy-size 2 --ball-z-size 4 --ball-overlap-fraction 0.4 --batch-size 1024 --n-free-cpus 62

Error Message


Traceback (most recent call last):
  File "/home/mvn/conda/envs/BG_test/bin/brainmapper", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/mvn/conda/envs/BG_test/lib/python3.12/site-packages/brainglobe_workflows/brainmapper/main.py", line 94, in main
    run_all(args, what_to_run, atlas)
  File "/home/mvn/conda/envs/BG_test/lib/python3.12/site-packages/brainglobe_workflows/brainmapper/main.py", line 168, in run_all
    points = classify.main(
             ^^^^^^^^^^^^^^
  File "/home/mvn/conda/envs/BG_test/lib/python3.12/site-packages/cellfinder/core/classify/classify.py", line 71, in main
    if trained_model and trained_model.suffix == ".h5":
                         ^^^^^^^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'suffix'

@Eddymorphling Eddymorphling added the bug Something isn't working label Jan 21, 2025
@IgorTatarnikov
Copy link
Member

Hi @Eddymorphling this was fixed in #471, however this hasn't been released yet.

@alessandrofelder can we release v.1.4.0alpha0?

@alessandrofelder
Copy link
Member

Fine by me. Are you happy to do this, @IgorTatarnikov ?

@Eddymorphling
Copy link
Author

Thank you!

@Eddymorphling
Copy link
Author

Eddymorphling commented Jan 21, 2025

Perfect, just downloaded cellfinder 1.4.0. Everything works like a charm! Thanks! @IgorTatarnikov @alessandrofelder

Also this PR to run 2d/3D filtering on Pytorch is much faster and a beautiful idea!

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