Datasets:

Tasks:
Other
Languages:
English
ArXiv:
License:

Why is this this error "Invalid string class label moving drawer of night stand"keep showing

#3
by Dx7r - opened

i did everything as the notice said as
"To use Something-Something-v2, please download the 19 data files and the labels file ""from 'https://developer.qualcomm.com/software/ai-datasets/something-something'. ""Unzip the 19 files and concatenate the extracts in order into a tar file named '20bn-something-something-v2.tar.gz. ""Use command like cat 20bn-something-something-v2-?? >> 20bn-something-something-v2.tar.gz ""Place the labels.zip file and the tar file into a folder '/path/to/data/' and load the dataset using " "load_dataset('something-something-v2', data_dir='/path/to/data')"
but the thing is it kept showing "Invalid string class label moving drawer of night stand" can you help me with this problem? THX

I'm getting the same issue

hey, getting the same issue now....do you know how to resolve this?

i am also getting something similar to that:

ValueError: Invalid string class label pretending to put bowl on a surface

anyone solved it?

i am also getting something similar to that:

ValueError: Invalid string class label pretending to put bowl on a surface

anyone solved it?

yes, the dataset loading script is, in my opinion, incorrect
for each example the annotations include a dict like this:

{"id":"78687","label":"holding potato next to vicks vaporub bottle","template":"Holding [something] next to [something]","placeholders":["potato","vicks vaporub bottle"]}

but the labels in the labels.json are like this:

 "Approaching something with your camera":"0",
 "Attaching something to something":"1",
 "Bending something so that it deforms":"2",
 "Bending something until it breaks":"3",

i.e. the "template" field contains one of the items in this file and these are treated as class labels by the loading script
the script, however, tries to match the values of the "label" field, which is actually free text since they are obtained by replacing the placeholders in the template:

    def _info(self):
        return datasets.DatasetInfo(
            description=_DESCRIPTION,
            features=datasets.Features(
                {
                    "video_id": datasets.Value("string"),
                    "video": datasets.Value("string"),
                    "text": datasets.Value("string"),
                    "label": datasets.features.ClassLabel(
                        num_classes=len(SOMETHING_SOMETHING_V2_CLASSES),
                        names=SOMETHING_SOMETHING_V2_CLASSES,
                    ),
                    "placeholders": datasets.Sequence(datasets.Value("string")),
                }
            ),
            supervised_keys=None,
            homepage="",
            citation=_CITATION,
        )
...
        for path, file in video_files:
            video_id = os.path.splitext(os.path.split(path)[1])[0]

            if video_id not in data:
                continue

            info = data[video_id]
            yield idx, {
                "video_id": video_id,
                "video": file,
                "placeholders": info.get("placeholders", []),
                "label": info["label"] if "label" in info else -1,
                "text": info["template"],
            }

so by changing the above code as follows:

        return datasets.DatasetInfo(
            description=_DESCRIPTION,
            features=datasets.Features(
                {
                    "video_id": datasets.Value("string"),
                    "video": datasets.Value("string"),
                    "label": datasets.Value("string"),
                    "template": datasets.features.ClassLabel(
                        num_classes=len(SOMETHING_SOMETHING_V2_CLASSES),
                        names=SOMETHING_SOMETHING_V2_CLASSES,
                    ),
                    "placeholders": datasets.Sequence(datasets.Value("string")),
                }
            ),
            supervised_keys=None,
            homepage="",
            citation=_CITATION,
        )
...
        for path, file in video_files:
            video_id = os.path.splitext(os.path.split(path)[1])[0]

            if video_id not in data:
                continue
            
            breakpoint()
            info = data[video_id]
            yield idx, {
                "video_id": video_id,
                "video": file,
                "placeholders": info.get("placeholders", []),
                "template": info["template"],
                "label": info["label"] if "label" in info else -1,
            }

            idx += 1

the dataset loading works again
maybe I'll try to submit this as a patch

actually, it's sufficient to change lines 159-160 to this to make it match the dataset card:

            info = data[video_id]
            yield idx, {
                "video_id": video_id,
                "video": file,
                "placeholders": info.get("placeholders", []),
                "label": info["template"],
                "text": info["label"] if "label" in info else -1,
            }

            idx += 1

Sign up or log in to comment