Open maggiorante opened 6 months ago
Label studio works just fine but i did not look into how it does so. I quickly saw that there is a call that only validates the configuration template with a json schema though. I suppose this validation is successful but the crash may trigger after the configuration is set.
Hi,
I was following the SAM tutorial at https://labelstud.io/tutorials/segment_anything_model and i watched the linked video to get the sample label configuration since the link did not work. This is the configuration:
I did not know what the Relations tag was so i went and checked on the documentation and it does not require any name or toName attribute to be set. This configuration does work inside labelstudio but when i try to add the ml backend i get this error:
I tried debugging with a simplified configuration
and discovered that the Relations elements needs the attributes name and toName to be set in order to work (which are not specified inside the documentation).
This is because in label_studio_sdk/label_interface/control_tags.py ControlTag.validate_node() is written like this:
Relations tag is a ControlTag but it is never recognized as such hence inside label_studio_sdk/label_interface/interface.py the loop on the xml_tree (lines 420 to 434) never adds it to the controls. A Relation tag is detected as a LabelTag so we enter the second elif. LabelTag.parse_node() needs the controls array as an argument but the Relations control tag is not inside it. Inside label_studio_sdk/label_interface/label_tags.py LabelTag.parse_node() makes a call to _get_parent_control_tag_name() passing tag and controls array but this function returns None (traversing the whole tree to the root) and parse_node finally returns None. lb.parent_name causes the crash since lb is None.
Hope this is as detailed and helpful as possible. This may not be an error but i hope the documentation can be updated if this was the case!
edit 1,2: make paths generic