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

labelme_json_to_dataset __array__() error #880

Closed
Xelach opened this issue Jul 1, 2021 · 4 comments
Closed

labelme_json_to_dataset __array__() error #880

Xelach opened this issue Jul 1, 2021 · 4 comments

Comments

@Xelach
Copy link

Xelach commented Jul 1, 2021

Hello,

I wanted to create a mask via the command: labelme_json_to_dataset pic1.json -o pic1json
The directory was created but is empty and i get the error message:
TypeError: array() takes 1 positional argument but 2 were given

You got any Ideas what the issue is?

BR,
Xelach

@abbas-tari
Copy link

This happens for me when I want to convert to coco format for example!!

@AdieResearch
Copy link

AdieResearch commented Jul 2, 2021

Same issue for me for both 'labelme_json_to_dataset' and 'labelme_draw_json'

Full error output:

Traceback (most recent call last):
  File "\LabelMe_Annotator\venv\Scripts\labelme_draw_json-script.py", line 33, in <module>
    sys.exit(load_entry_point('labelme==4.5.9', 'console_scripts', 'labelme_draw_json')())
  File "\LabelMe_Annotator\venv\lib\site-packages\labelme\cli\draw_json.py", line 32, in main
    lbl, _ = utils.shapes_to_label(
  File "\LabelMe_Annotator\venv\lib\site-packages\labelme\utils\shape.py", line 71, in shapes_to_label
    mask = shape_to_mask(img_shape[:2], points, shape_type)
  File "\LabelMe_Annotator\venv\lib\site-packages\labelme\utils\shape.py", line 47, in shape_to_mask
    mask = np.array(mask, dtype=bool)

TypeError: __array__() takes 1 positional argument but 2 were given

EDIT
It appears to be an issue with Pillow (python-pillow/Pillow#5572). I have fixed this by rolling back to Pillow version 8.2.0 until the official fix is merged.

@Xelach
Copy link
Author

Xelach commented Jul 6, 2021

That was the fix for me. Thanks!

@Xelach Xelach closed this as completed Jul 6, 2021
@S0ngZ1Chen
Copy link

Hi! This is my problem,could you help me?
errer.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants