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

ZeroDivisionError when attempting to download annotations #1437

Closed
akarimbux opened this issue Apr 20, 2020 · 5 comments
Closed

ZeroDivisionError when attempting to download annotations #1437

akarimbux opened this issue Apr 20, 2020 · 5 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@akarimbux
Copy link

My actions before raising this issue

I searched both existing issues and gitter for this error and couldn't find a reference

Current Behaviour

XML that causes this issue attached.

I am running into an issue with the TASK endpoint where annotations that have loaded successfully raise an error when I attempt to download them. The created task has a segment size of 1500 frames and 5 frames of overlap. This generates 2 jobs against which the attached annotation xml file is loaded.

Without making any changes to the annotations, attempting to download them, throws the following error:

`
2020-04-20 17:56:51,915 DEBG 'rqworker_default_1' stderr output:
17:56:51 cvat.apps.engine.utils.InterpreterError: AssertionError
Traceback (most recent call last):
File "/home/django/cvat/apps/engine/utils.py", line 45, in execute_python_code
exec(source_code, global_vars, local_vars)
File "", line 1, in
File "", line 393, in dump_as_cvat_interpolation
File "/home/django/cvat/apps/annotation/annotation.py", line 341, in tracks
tracked_shapes = TrackManager.get_interpolated_shapes(track, 0, self._db_task.size)
File "/home/django/cvat/apps/engine/data_manager.py", line 360, in get_interpolated_shapes
assert shape["frame"] > curr_frame
AssertionError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/rq/worker.py", line 812, in perform_job
rv = job.perform()
File "/usr/local/lib/python3.5/dist-packages/rq/job.py", line 588, in perform
self._result = self._execute()
File "/usr/local/lib/python3.5/dist-packages/rq/job.py", line 594, in _execute
return self.func(*self.args, **self.kwargs)
File "/home/django/cvat/apps/engine/annotation.py", line 135, in dump_task_data
annotation.dump(filename, dumper, scheme, host)
File "/home/django/cvat/apps/engine/annotation.py", line 740, in dump
execute_python_code("{}(file_object, annotations)".format(dumper.handler), global_vars)
File "/home/django/cvat/apps/engine/utils.py", line 54, in execute_python_code
raise InterpreterError("{}".format(error_class))
cvat.apps.engine.utils.InterpreterError: AssertionError
Traceback (most recent call last):
File "/home/django/cvat/apps/engine/utils.py", line 45, in execute_python_code
exec(source_code, global_vars, local_vars)
File "", line 1, in
File "", line 393, in dump_as_cvat_interpolation
File "/home/django/cvat/apps/annotation/annotation.py", line 341, in tracks
tracked_shapes = TrackManager.get_interpolated_shapes(track, 0, self._db_task.size)
File "/home/django/cvat/apps/engine/data_manager.py", line 360, in get_interpolated_shapes
assert shape["frame"] > curr_frame
AssertionError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/rq/worker.py", line 812, in perform_job
rv = job.perform()
File "/usr/local/lib/python3.5/dist-packages/rq/job.py", line 588, in perform
self._result = self._execute()
File "/usr/local/lib/python3.5/dist-packages/rq/job.py", line 594, in _execute
return self.func(*self.args, **self.kwargs)
File "/home/django/cvat/apps/engine/annotation.py", line 135, in dump_task_data
annotation.dump(filename, dumper, scheme, host)
File "/home/django/cvat/apps/engine/annotation.py", line 740, in dump
execute_python_code("{}(file_object, annotations)".format(dumper.handler), global_vars)
File "/home/django/cvat/apps/engine/utils.py", line 54, in execute_python_code
raise InterpreterError("{}".format(error_class))
cvat.apps.engine.utils.InterpreterError: AssertionError
`

Sometimes a different error is thrown using the same set of actions above:
ZeroDivisionError: division by zero Traceback (most recent call last): File "/usr/local/lib/python3.5/dist-packages/rq/worker.py", line 812, in perform_job rv = job.perform() File "/usr/local/lib/python3.5/dist-packages/rq/job.py", line 588, in perform self._result = self._execute() File "/usr/local/lib/python3.5/dist-packages/rq/job.py", line 594, in _execute return self.func(*self.args, **self.kwargs) File "/usr/lib/python3.5/contextlib.py", line 30, in inner return func(*args, **kwds) File "/home/django/cvat/apps/engine/annotation.py", line 112, in load_task_data annotation.upload(filename, loader) File "/home/django/cvat/apps/engine/annotation.py", line 761, in upload self.create(annotation_importer.data.serialize()) File "/home/django/cvat/apps/engine/annotation.py", line 697, in create self._patch_data(data, PatchAction.CREATE) File "/home/django/cvat/apps/engine/annotation.py", line 687, in _patch_data self._merge_data(_data, jobs[jid]["start"], self.db_task.overlap) File "/home/django/cvat/apps/engine/annotation.py", line 691, in _merge_data data_manager.merge(data, start_frame, overlap) File "/home/django/cvat/apps/engine/data_manager.py", line 22, in merge tracks.merge(data.tracks, start_frame, overlap) File "/home/django/cvat/apps/engine/data_manager.py", line 107, in merge int_obj, old_obj, start_frame, overlap) File "/home/django/cvat/apps/engine/data_manager.py", line 278, in _calc_objects_similarity return 1 - error / count ZeroDivisionError: division by zero

Your Environment

  • Git hash commit (git log -1): feebec2
  • Docker version docker version (e.g. Docker 17.0.05): 19.03.8
  • Are you using Docker Swarm or Kubernetes? No
  • Operating System and version (e.g. Linux, Windows, MacOS): Ubuntu

Next steps

You may join our Gitter channel for community support.

bad.xml.txt

@azhavoro azhavoro self-assigned this Apr 21, 2020
@nmanovic nmanovic added the bug Something isn't working label Apr 22, 2020
@nmanovic nmanovic added this to the 1.0.0-beta.2 milestone Apr 22, 2020
@nmanovic
Copy link
Contributor

@azhavoro , please verify that we already have a fix for the issue. Otherwise please assign a correct milestone target.

@azhavoro
Copy link
Contributor

should be fixed by #1396, but need to re-upload annotation.

@nmanovic nmanovic closed this as completed May 1, 2020
@joon612
Copy link

joon612 commented May 25, 2021

It seems reproduced in current version. (commit id: 2b221d2).
docker version: 19.03.13
Operating System: Ubuntu 18
We have 1 task including 11 jobs. After annotation, we cannot dump annotations by 'cvat for videos 1.1'.
image

image
cvat_server.log
[2021-05-25 03:02:45,692] ERROR cvat.server.task_1608: [cvat.apps.dataset_manager.views @ export_task]: exception occurred
Traceback (most recent call last):
File "/home/django/cvat/apps/dataset_manager/views.py", line 61, in export_task
task.export_task(task_id, temp_file, dst_format,
File "/home/django/cvat/apps/dataset_manager/task.py", line 744, in export_task
task.init_from_db()
File "/home/django/cvat/apps/dataset_manager/task.py", line 622, in init_from_db
self._merge_data(annotation.ir_data, start_frame, overlap)
File "/home/django/cvat/apps/dataset_manager/task.py", line 593, in _merge_data
annotation_manager.merge(data, start_frame, overlap)
File "/home/django/cvat/apps/dataset_manager/annotation.py", line 149, in merge
tracks.merge(data.tracks, start_frame, overlap)
File "/home/django/cvat/apps/dataset_manager/annotation.py", line 233, in merge
cost_matrix[i][j] = 1 - self._calc_objects_similarity(
File "/home/django/cvat/apps/dataset_manager/annotation.py", line 407, in _calc_objects_similarity
return 1 - error / count
ZeroDivisionError: division by zero
[2021-05-25 03:02:45,809] ERROR django.request: Internal Server Error: /api/v1/tasks/1608/annotations

@azhavoro
Copy link
Contributor

@joon612 Please provide steps to reproduce this issue

@joon612
Copy link

joon612 commented May 25, 2021

@azhavoro
We create a cvat task by cli, including 11 jobs, "segment_size": 4500.
After that we do annotation jobs, labeling manually.
After annotation job, we save operations and return to task page.
We use 'Actions -> Dump annotations -> CVAT for video 1.1' to dump annotation file.
Finally we got this error in the upper right corner of the screen.
image

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants