Unable to upload new images in a created Visual Question Answering task
Describe the bug Unable to upload a new image in a created VQA task, the following appears when uploading an image:
[0daf5e7a-bba8-4a2a-a6b2-a2d2ea423ab8] Validation error (Failed to parse input file upload/20/b95b6c59-00005.jpg: [ErrorDetail(string='Your label config has more than one data key and direct file upload supports only one data key. To import data with multiple data keys, use a JSON or CSV file.', code='invalid')])
What do I have to do to fix it?
To Reproduce Steps to reproduce the behavior:
- Go to '...'
- Click on '....'
- Scroll down to '....'
- See error
Expected behavior A clear and concise description of what you expected to happen.
Screenshots If applicable, add screenshots to help explain your problem.
Environment (please complete the following information):
- OS: [e.g. iOS]
- Label Studio Version [e.g. 0.8.0]
Additional context Add any other context about the problem here.
do we know how solve it or not yet?
The error occurs because in Label Studio, when we upload an image directly (drag & drop or file upload), there can only be one data key in the labeling configuration.
👉 What this means is that in the label config (XML setup for the project), there can be more than one <Image value="..."> or <Data value="..."> element.
Incorrect example (having more than one key):
<View>
<Image name="img1" value="$image"/>
<Image name="img2" value="$image2"/>
</View>
If you use direct upload, it doesn't work, because Label Studio is confused about which data field to use (image or image2).
Solution:
1. If you only want one image per task:
Make sure there is only one data key in the configuration, for example:
<View>
<Image name="image" value="$image"/>
<Choices name="label" toName="image">
<Choice value="Cat"/>
<Choice value="Dog"/>
</Choices>
</View>
Then upload the image directly to the project.
2. If you need multiple data keys (e.g., image + text, or two images at once):
You cannot use direct file upload. You must use JSON/CSV import. Example JSON format:
[
{
"image": "https://example.com/image1.jpg",
"image2": "https://example.com/image2.jpg"
}
]
Or CSV:
image,image2
https://example.com/image1.jpg,https://example.com/image2.jpg
⚡ So the bottom line:
-
Direct upload → only 1
<Image>ordata key. - Multiple data keys → use JSON/CSV import.