MouseLand / suite2p

cell detection in calcium imaging recordings
http://www.suite2p.org
GNU General Public License v3.0
360 stars 244 forks source link

BUG: error in anatomical detection using cellpose 3 #1101

Closed nguyemi5 closed 8 months ago

nguyemi5 commented 8 months ago

Describe the issue:

Hi, I ran into this error when using anatomical detection in suite2p on a tif file. It seems to be related the new cellpose version, as downgrading cellpose workaround from #1093 works. Thanks!

Reproduce the code example:

python -m suite2p
loaded default ops
loading ops

I'm using default ops and
Anat detect:
anatomical_only = 1
diameter = 12
cellprob_threshold = 0.1

Error message:

>>>ERROR<<<
Traceback (most recent call last):
  File "/home/jananguyen/anaconda3/envs/suite2p_test/lib/python3.9/runpy.py", line 197, in _run_module_as_main
>>>ERROR<<<
    return _run_code(code, main_globals, None,
  File "/home/jananguyen/anaconda3/envs/suite2p_test/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/jananguyen/Jana/suite2p/suite2p/__main__.py", line 84, in <module>
    main()
  File "/home/jananguyen/Jana/suite2p/suite2p/__main__.py", line 77, in main
    run_s2p(ops, db)
  File "/home/jananguyen/Jana/suite2p/suite2p/run_s2p.py", line 538, in run_s2p
    op = run_plane(op, ops_path=ops_path)
  File "/home/jananguyen/Jana/suite2p/suite2p/run_s2p.py", line 336, in run_plane
    ops = pipeline(f_reg, f_raw, f_reg_chan2, f_raw_chan2, run_registration, ops,
  File "/home/jananguyen/Jana/suite2p/suite2p/run_s2p.py", line 165, in pipeline
    ops, stat = detection.detection_wrapper(f_reg, ops=ops, classfile=classfile)
  File "/home/jananguyen/Jana/suite2p/suite2p/detection/detect.py", line 175, in detection_wrapper
    stat = anatomical.select_rois(ops=ops, mov=mov,
  File "/home/jananguyen/Jana/suite2p/suite2p/detection/anatomical.py", line 209, in select_rois
    masks, centers, median_diam, mask_diams = roi_detect(
  File "/home/jananguyen/Jana/suite2p/suite2p/detection/anatomical.py", line 108, in roi_detect
    masks = model.eval(mproj, net_avg=True, channels=[0, 0], diameter=diameter,
TypeError: eval() got an unexpected keyword argument 'net_avg'
Interrupted by error (not finished)

Version information:

suite2p v0.14.3

Context for the issue:

ERROR<<< Traceback (most recent call last): File "/home/jananguyen/anaconda3/envs/suite2p_test/lib/python3.9/runpy.py", line 197, in _run_module_as_main ERROR<<< return _run_code(code, main_globals, None, File "/home/jananguyen/anaconda3/envs/suite2p_test/lib/python3.9/runpy.py", line 87, in _run_code exec(code, run_globals) File "/home/jananguyen/Jana/suite2p/suite2p/main.py", line 84, in main() File "/home/jananguyen/Jana/suite2p/suite2p/main.py", line 77, in main run_s2p(ops, db) File "/home/jananguyen/Jana/suite2p/suite2p/run_s2p.py", line 538, in run_s2p op = run_plane(op, ops_path=ops_path) File "/home/jananguyen/Jana/suite2p/suite2p/run_s2p.py", line 336, in run_plane ops = pipeline(f_reg, f_raw, f_reg_chan2, f_raw_chan2, run_registration, ops, File "/home/jananguyen/Jana/suite2p/suite2p/run_s2p.py", line 165, in pipeline ops, stat = detection.detection_wrapper(f_reg, ops=ops, classfile=classfile) File "/home/jananguyen/Jana/suite2p/suite2p/detection/detect.py", line 175, in detection_wrapper stat = anatomical.select_rois(ops=ops, mov=mov, File "/home/jananguyen/Jana/suite2p/suite2p/detection/anatomical.py", line 209, in select_rois masks, centers, median_diam, mask_diams = roi_detect( File "/home/jananguyen/Jana/suite2p/suite2p/detection/anatomical.py", line 108, in roi_detect masks = model.eval(mproj, net_avg=True, channels=[0, 0], diameter=diameter, TypeError: eval() got an unexpected keyword argument 'net_avg' Interrupted by error (not finished)

chriski777 commented 8 months ago

Thanks @nguyemi5 for letting us know about this issue! This should now be fixed in the latest version on the main branch.