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

Can't upload my annotation file (coco format) #5773

Closed
DavidShaer opened this issue Feb 27, 2023 · 1 comment · Fixed by #5909
Closed

Can't upload my annotation file (coco format) #5773

DavidShaer opened this issue Feb 27, 2023 · 1 comment · Fixed by #5909
Assignees
Labels
bug Something isn't working duplicate This issue or pull request already exists server

Comments

@DavidShaer
Copy link

Hi,
I'm trying to upload my annotation file (coco format)
The images were loaded with no issues, but when trying to upload the annotations (zip file) I got the following error:
Could not upload annotation for the task 92382
Error: tus: unexpected response while creating upload, originated from request (method: POST, url: https://app.cvat.ai/api/jobs/91972/annotations/, response code: 409, response text: "File with same name already exists", request id: n/a).

The structure is as follows:
cvat_data_test_coco.zip
-> annotations -> instances_default.json
-> images -> 000000.jpg, 000001.jpg, 000002.jpg

The annotation file looks as follows:
{"licenses": [{"name": "", "id": 0, "url": ""}], "info": {"contributor": "", "date_created": "", "description": "", "url": "", "version": "", "year": ""}, "categories": [{"id": 1, "name": "product", "supercategory": ""}, {"id": 2, "name": "credit_card", "supercategory": ""}, {"id": 3, "name": "phone", "supercategory": ""}, {"id": 4, "name": "wallet", "supercategory": ""}, {"id": 5, "name": "hands_only", "supercategory": ""}, {"id": 6, "name": "other", "supercategory": ""}], "images": [{"id": 1, "width": 1920, "height": 1080, "file_name": "/Users/davidshaer/Desktop/composite/projects/fujitsu-scan-avoidance/products_tracking_data_collection/post_processing_results/cvat_data_test_coco/images/000001.jpg", "license": 0, "flickr_url": "", "coco_url": "", "date_captured": 0}, {"id": 2, "width": 1920, "height": 1080, "file_name": "/Users/davidshaer/Desktop/composite/projects/fujitsu-scan-avoidance/products_tracking_data_collection/post_processing_results/cvat_data_test_coco/images/000000.jpg", "license": 0, "flickr_url": "", "coco_url": "", "date_captured": 0}, {"id": 3, "width": 1920, "height": 1080, "file_name": "/Users/davidshaer/Desktop/composite/projects/fujitsu-scan-avoidance/products_tracking_data_collection/post_processing_results/cvat_data_test_coco/images/000002.jpg", "license": 0, "flickr_url": "", "coco_url": "", "date_captured": 0}], "annotations": [{"id": 1, "image_id": 1, "category_id": 1, "segmentation": [], "area": 45466, "bbox": [916, 339, 179, 254], "iscrowd": 0, "attributes": {"occluded": false, "track_id": 1, "keyframe": true}}, {"id": 2, "image_id": 2, "category_id": 1, "segmentation": [], "area": 45466, "bbox": [916, 339, 179, 254], "iscrowd": 0, "attributes": {"occluded": false, "track_id": 2, "keyframe": true}}, {"id": 3, "image_id": 3, "category_id": 1, "segmentation": [], "area": 45466, "bbox": [916, 339, 179, 254], "iscrowd": 0, "attributes": {"occluded": false, "track_id": 3, "keyframe": true}}]}

Environment:
mac os
CVAT online

Any help will be appreciated
Thanks
David

@zhiltsov-max
Copy link
Contributor

zhiltsov-max commented Mar 13, 2023

Hi, thanks for reporting the problem. As a workaround, please rename the archive file and try to upload it again.

Duplicate of #5563

@zhiltsov-max zhiltsov-max added bug Something isn't working server labels Mar 13, 2023
@Marishka17 Marishka17 self-assigned this Mar 22, 2023
@zhiltsov-max zhiltsov-max added the duplicate This issue or pull request already exists label Mar 22, 2023
@Marishka17 Marishka17 mentioned this issue Mar 24, 2023
9 tasks
SpecLad added a commit that referenced this issue Jun 2, 2023
Fixed:
- wrong location of tmp file when importing job annotations
- ```Traceback (most recent call last):
File
"/home/maya/Documents/cvat/.env/lib/python3.8/site-packages/rq/worker.py",
line 795, in work
      self.execute_job(job, queue)
File "/home/maya/Documents/cvat/cvat/rqworker.py", line 37, in
execute_job
      return self.perform_job(*args, **kwargs)
File
"/home/maya/Documents/cvat/.env/lib/python3.8/site-packages/rq/worker.py",
line 1389, in perform_job
      self.handle_exception(job, *exc_info)
File
"/home/maya/Documents/cvat/.env/lib/python3.8/site-packages/rq/worker.py",
line 1438, in handle_exception
      fallthrough = handler(job, *exc_info)
File "/home/maya/Documents/cvat/cvat/apps/engine/views.py", line 2233,
in rq_exception_handler
      rq_job.exc_info = "".join(
  AttributeError: can't set attribute
  ```

Resolves #5773
Resolves #5563

- root causes of the issues: 
  - the annotation file was uploaded to the server by tus protocol and
rq job was created but no one next requests for checking status were not
made. (e.g. user closed the browser tab)
  - the annotation file was uploaded to the server by tus protocol but
rq job has not yet been created (e.g cvat instance restarted)
  - tasks/projects creation from backups with the same name at the
same time by different users

Co-authored-by: Roman Donchenko <roman@cvat.ai>
Co-authored-by: Maxim Zhiltsov <zhiltsov.max35@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working duplicate This issue or pull request already exists server
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants