question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

These labels still exist in annotations error

See original GitHub issue

Getting These labels still exist in annotations error when trying to delete object classes in labeling interface even though all objects of this class were removed.

Tried using label-studio filter by “annotations results” and also made a direct SQL-query select * from task_completion tc where "result" LIKE '%cage%' to check that there are no more annotations of that class.

Restarting label-studio doesn’t help.

Environment:

  • OS: Ubuntu 20.04
  • Label Studio Version 1.0.0-post3

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
1yticcommented, Oct 27, 2021

Could you try these steps to reproduce the issue:

  1. Create an empty project and feed the two tasks
  2. Label two tasks with different labels
  3. Try to remove one of tasks with annotation
  4. Try to change labels in the settings

Current behaviours:

a) In previous release like this one heartexlabs/label-studio@sha256:95232dfce519ce13b7e6aebf118242817f999bff2ba17ebbaff295199a12a506 Label Studio will silently remove the task, but will prevent changes for labels

b) In latest release like heartexlabs/label-studio@sha256:e048d8df494e0e4b08ce7a928705a4f6d2178b717ddd2cd2ecef333ad2e0d7ba Label Studio will show this Runtime Error:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/django/db/models/fields/related_descriptors.py", line 173, in __get__
    rel_obj = self.field.get_cached_value(instance)
  File "/usr/local/lib/python3.8/dist-packages/django/db/models/fields/mixins.py", line 15, in get_cached_value
    return instance._state.fields_cache[cache_name]
KeyError: 'task'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/rest_framework/views.py", line 506, in dispatch
    response = handler(request, *args, **kwargs)
  File "/usr/local/lib/python3.8/dist-packages/django/utils/decorators.py", line 43, in _wrapper
    return bound_method(*args, **kwargs)
  File "/label-studio/label_studio/data_manager/api.py", line 393, in post
    result = perform_action(action_id, project, queryset, request.user, **kwargs)
  File "/label-studio/label_studio/data_manager/actions/__init__.py", line 108, in perform_action
    raise e
  File "/label-studio/label_studio/data_manager/actions/__init__.py", line 104, in perform_action
    result = action['entry_point'](project, queryset, **kwargs)
  File "/label-studio/label_studio/data_manager/actions/basic.py", line 53, in delete_tasks
    queryset.delete()
  File "/usr/local/lib/python3.8/dist-packages/django/db/models/query.py", line 747, in delete
    deleted, _rows_count = collector.delete()
  File "/usr/local/lib/python3.8/dist-packages/django/db/models/deletion.py", line 435, in delete
    signals.post_delete.send(
  File "/usr/local/lib/python3.8/dist-packages/django/dispatch/dispatcher.py", line 177, in send
    return [
  File "/usr/local/lib/python3.8/dist-packages/django/dispatch/dispatcher.py", line 178, in <listcomp>
    (receiver, receiver(signal=self, sender=sender, **named))
  File "/label-studio/label_studio/io_storages/s3/models.py", line 224, in delete_annotation_from_s3_storages
    project = instance.task.project
  File "/usr/local/lib/python3.8/dist-packages/django/db/models/fields/related_descriptors.py", line 187, in __get__
    rel_obj = self.get_object(instance)
  File "/usr/local/lib/python3.8/dist-packages/django/db/models/fields/related_descriptors.py", line 154, in get_object
    return qs.get(self.field.get_reverse_related_filter(instance))
  File "/usr/local/lib/python3.8/dist-packages/django/db/models/query.py", line 429, in get
    raise self.model.DoesNotExist(
tasks.models.Task.DoesNotExist: Task matching query does not exist.

Example of label config:

<View>
  <Labels name="words" toName="view">
    <Label value="Word1" alias="W1"/>
    <Label value="Word2" alias="W2"/>
  </Labels>
  <Text name="view" value="$description1"/>
</View>

Example of creating tasks:

import requests

address = "http://localhost:8081"
token = "xxx"
headers = {"Authorization": f"Token {token}"}

data = {
    "version1": "1",
    "description1": "long text"
}

payload = {
    "data": data,
    "project": 1,
}
response = requests.post(address + "/api/tasks/", json=payload, headers=headers)
print(response.json())
1reaction
csaroffcommented, Feb 16, 2022

This appears to be fixed as of v1.4.1post1(didn’t try rc0).

Thanks @makseq!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Convert Labels to Annotation Failing (Error 000287...
I keep trying to convert my labels to annotations using ArcPro and keep getting this error: 000287: Failed to create output feature class....
Read more >
ArcMap 10.8.1 error creating annotation feature class. General ...
I have a folder with labels stored in shape format. We use to convert labels into annotations in a second step.
Read more >
Label Studio Documentation — Troubleshoot Label Studio
If you encounter an issue using Label Studio, use this page to troubleshoot ... Go to browser console (Ctrl + Shift + i...
Read more >
Converting labels to annotation—Help | ArcGIS for Desktop
Some labels may not be currently displayed on the map because there is no room for them. To convert these labels, check the...
Read more >
Non-Terminal JSON Line Validation Errors - Rekognition
Validation errors typically occur in manually created manifest files. ... You can't use the Amazon Rekognition Custom Labels console to fix this error....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found