Skip to content

TypeError: imsave() missing 1 required positional argument: 'arr' in run_Cellpose-SAM.ipynb #1208

@Jiadalee

Description

@Jiadalee

Describe the bug
I'm running the run_Cellpose-SAM.ipynb file in colab with gpu, but got the TypeError: imsave() missing 1 required positional argument: 'arr' . To resolve this issue, I double checked the io.imsave() and io.save_rois() API guide. I found these two functions do not return anything, so you cannot assign the output to a variable. The code line masks0 = io.imsave(dir / (f.name + "_masks" + masks_ext)) should be corrected to be io.imsave(dir / (f.name + "_masks" + masks_ext)), and then it works fine. I'd like to submit a PR if this raised issue and fix looks good to you

To Reproduce
Steps to reproduce the behavior:

  1. Go to run_Cellpose-SAM.ipynb
  2. run run_Cellpose-SAM.ipynb
  3. Scroll down to final bottom code block
  4. See error : TypeError: imsave() missing 1 required positional argument: 'arr'

Run log
Error message:

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
[<ipython-input-14-330c8aba240f>](https://localhost:8080/#) in <cell line: 0>()
      1 for i in trange(len(files)):
      2     f = files[i]
----> 3     masks0 = io.imsave(dir / (f.name + "_masks" + masks_ext))
      4     io.save_rois(masks0, f)

TypeError: imsave() missing 1 required positional argument: 'arr'

Code block:

for i in trange(len(files)):
    f = files[i]
    masks0 = io.imsave(dir / (f.name + "_masks" + masks_ext))
    io.save_rois(masks0, f)

Screenshots

Image

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions