I was connecting my label studio UI to the backend and had following error:
[2024-06-14 14:57:13,452] [ERROR] [label_studio_ml.exceptions::exception_f::53] Traceback (most recent call last):
File "/share/home/hanh/code-repository/label-studio-ml-backend/label_studio_ml/exceptions.py", line 39, in exception_f
return f(*args, **kwargs)
File "/share/home/hanh/code-repository/label-studio-ml-backend/label_studio_ml/api.py", line 99, in _setup
model = MODEL_CLASS(project_id=project_id,
File "/share/home/hanh/code-repository/label-studio-ml-backend/label_studio_ml/model.py", line 81, in __init__
self.use_label_config(label_config)
File "/share/home/hanh/code-repository/label-studio-ml-backend/label_studio_ml/model.py", line 106, in use_label_config
self.label_interface = LabelInterface(config=label_config)
File "/home/hanh/.conda/envs/ner_ls_backend/lib/python3.9/site-packages/label_studio_sdk/label_interface/interface.py", line 215, in __init__
controls, objects, labels, tree = self.parse(config)
File "/home/hanh/.conda/envs/ner_ls_backend/lib/python3.9/site-packages/label_studio_sdk/label_interface/interface.py", line 432, in parse
labels[lb.parent_name][lb.value] = lb
AttributeError: 'NoneType' object has no attribute 'parent_name'
Traceback (most recent call last):
File "/share/home/hanh/code-repository/label-studio-ml-backend/label_studio_ml/exceptions.py", line 39, in exception_f
return f(*args, **kwargs)
File "/share/home/hanh/code-repository/label-studio-ml-backend/label_studio_ml/api.py", line 99, in _setup
model = MODEL_CLASS(project_id=project_id,
File "/share/home/hanh/code-repository/label-studio-ml-backend/label_studio_ml/model.py", line 81, in __init__
self.use_label_config(label_config)
File "/share/home/hanh/code-repository/label-studio-ml-backend/label_studio_ml/model.py", line 106, in use_label_config
self.label_interface = LabelInterface(config=label_config)
File "/home/hanh/.conda/envs/ner_ls_backend/lib/python3.9/site-packages/label_studio_sdk/label_interface/interface.py", line 215, in __init__
controls, objects, labels, tree = self.parse(config)
File "/home/hanh/.conda/envs/ner_ls_backend/lib/python3.9/site-packages/label_studio_sdk/label_interface/interface.py", line 432, in parse
labels[lb.parent_name][lb.value] = lb
AttributeError: 'NoneType' object has no attribute 'parent_name'
The label config is like the following, and I noticed that the tag caused the error.
Hi
I was connecting my label studio UI to the backend and had following error:
The label config is like the following, and I noticed that the tag caused the error.
The error can be produced by
where the version of label_studio_sdk is 0.0.34 (the one used for label-studio-ml-backend).
However, I also noticed that it works without error in label_studio_sdk 1.0.1
If I want to get the code work for the label-studio-ml-backend (with label_studio_sdk 0.0.34), what should I do? Thanks a lot!