Err22 for COCO/YOLO export

Hi team !
Thank you very much for this new support community and for your dedication to help us.

I am reaching out to you again because I have been meeting an “Err22 : Invalid argument” when I try to export my annotations in COCO and YOLO format.

Here are the details of my current set up :

  • I installed LabelStudio with pip. I currently use the Label Studio 1.12 version in a Python 3.12 venv.
  • I set up a local server to upload my files, following your tutorials.
  • I annotated 800 images with Bounding Boxes. Some of the images have no annotations / rotated boxes.
  • I am using macOS Sonoma 14.2.1

Here are the details of my issue :

  • At first, I was working on Label Studio 1.8 with Python 3.7 to annotate my corpus. I had tried around march 2024 to test my work and exported my files in JSON and COCO : everything worked then.
  • I finished my annotations last week and updated to Label Studio 1.12 with Python 3.12 in a venv.
  • The export in JSON is currently working.
  • BUT here is the Err 22 for COCO/YOLO :
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/wsgiref/handlers.py", line 138, in run
    self.finish_response()
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/wsgiref/handlers.py", line 184, in finish_response
    self.write(data)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/wsgiref/handlers.py", line 293, in write
    self._write(data)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/wsgiref/handlers.py", line 467, in _write
    result = self.stdout.write(data)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/socketserver.py", line 826, in write
    self._sock.sendall(b)
OSError: [Errno 22] Invalid argument

Trying to fix this, I have tried to use LabelStudio 1.12 with Python 3.8, 3.9, 3.10 and 3.11 venv. I always get this same error.

What should I try to do ?
Should I just try to write my own conversion script as you mentioned in an other issue ?

Thank you very much again,

Alice

hey @alicetruc, thanks for posting here, sorry that the previous suggestions in Slack have not been helpful.

It seems like this is either a case of a regression with the code or something unique to your files/setup that is causing this error. At the moment, the error and stack trace are a bit non-descript so I’m not able to tell.

Can I ask you to enable debug logging in Label Studio to get more detailed output which might help in pinpointing the issue.

Alternatively, I can help provide a basic generated conversion script that might help in getting your data exported. One final option would be to downgrade to version 1.8 while our team works on trying to reproduce the issue. The latter obviously isn’t ideal but it may be the most direct way of getting you unblocked with your project at the moment.

Hi @sajarin,

Thank you very much again for your attentive answer.
Trying to go around the possibilities you offered, I finally managed to update to the new version of Label-Studio 1.12.1 (and Python 3.8). My problem has been solved then and I managed to export my annotations in COCO. I don’t know what worked with this new version but I am really grateful for your work.

Have a nice day,

Alice

Awesome, happy to hear it! Feel free to post more questions here @alicetruc :slight_smile:

1 Like