# Text Column not working with Image Folder

**URL:** <https://discuss.huggingface.co/t/text-column-not-working-with-image-folder/51855>\
**Category:** 🤗Datasets\
**Created:** [August 23, 2023, 4:26pm UTC](https://discuss.huggingface.co/t/text-column-not-working-with-image-folder/51855 "2023-08-23T16:26:54Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![JAFruin](https://avatars.discourse-cdn.com/v4/letter/j/ed8c4c/32.png) [@JAFruin](https://discuss.huggingface.co/u/JAFruin)\
**Post date:** [August 23, 2023, 4:26pm UTC](https://discuss.huggingface.co/t/text-column-not-working-with-image-folder/51855/1 "2023-08-23T16:26:54Z")

</div>

![image](https://us1.discourse-cdn.com/hellohellohello/original/3X/a/d/ad604542f1ca4150abc6abe1a0268579b42811e6.png)  
I’m trying to load a local custom image captioning dataset that I have filtered from a much larger one but I’m having issues where it seems that the Image Folder doesn’t seem to be picking up the captions/labels for the images or the csv file that they are contained on

---

<div class="post-metadata">

**Author:** ![mariosasko](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/mariosasko/32/31548_2.png) [@mariosasko](https://discuss.huggingface.co/u/mariosasko)\
**Post date:** [August 24, 2023, 2:52pm UTC](https://discuss.huggingface.co/t/text-column-not-working-with-image-folder/51855/2 "2023-08-24T14:52:31Z")

</div>

Hi! What’s the structure of the `Train_Images` and `Test_Images` folders and the contents of the metadata file(s)? You can obtain the folder structure using the `tree` command.

---

<div class="post-metadata">

**Author:** ![JAFruin](https://avatars.discourse-cdn.com/v4/letter/j/ed8c4c/32.png) [@JAFruin](https://discuss.huggingface.co/u/JAFruin)\
**Post date:** [August 24, 2023, 3:05pm UTC](https://discuss.huggingface.co/t/text-column-not-working-with-image-folder/51855/3 "2023-08-24T15:05:22Z")

</div>

![Screenshot 2023-08-24 160426](https://us1.discourse-cdn.com/hellohellohello/original/3X/e/7/e72b3cdaa4723688ff928b676adb33a50307f36e.png)  
Thanks for responding. The structure is as shown in this image. Also how would I use the tree command? Thanks.

---

<div class="post-metadata">

**Author:** ![mariosasko](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/mariosasko/32/31548_2.png) [@mariosasko](https://discuss.huggingface.co/u/mariosasko)\
**Post date:** [August 24, 2023, 3:20pm UTC](https://discuss.huggingface.co/t/text-column-not-working-with-image-folder/51855/4 "2023-08-24T15:20:09Z")

</div>

The metadata files must be named `metadata.csv` as explained [here](https://huggingface.co/docs/datasets/image_dataset).

---

<div class="post-metadata">

**Author:** ![JAFruin](https://avatars.discourse-cdn.com/v4/letter/j/ed8c4c/32.png) [@JAFruin](https://discuss.huggingface.co/u/JAFruin)\
**Post date:** [August 25, 2023, 2:58pm UTC](https://discuss.huggingface.co/t/text-column-not-working-with-image-folder/51855/5 "2023-08-25T14:58:00Z")

</div>

![image](https://us1.discourse-cdn.com/hellohellohello/original/3X/8/a/8a6fa16c31345e24ab1b77da4efa413f1f6a4813.png)  
The metadata file is still not picked up even when I renamed it?

---

<div class="post-metadata">

**Author:** ![mariosasko](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/mariosasko/32/31548_2.png) [@mariosasko](https://discuss.huggingface.co/u/mariosasko)\
**Post date:** [August 29, 2023, 4:32pm UTC](https://discuss.huggingface.co/t/text-column-not-working-with-image-folder/51855/6 "2023-08-29T16:32:57Z")

</div>

Can you replace `data_dir=` with `data_files=` in the last `load_dataset` call and try again?

---

<div class="post-metadata">

**Author:** ![JAFruin](https://avatars.discourse-cdn.com/v4/letter/j/ed8c4c/32.png) [@JAFruin](https://discuss.huggingface.co/u/JAFruin)\
**Post date:** [August 29, 2023, 4:45pm UTC](https://discuss.huggingface.co/t/text-column-not-working-with-image-folder/51855/7 "2023-08-29T16:45:53Z")

</div>

Hi, thanks for responding. I fixed the issue yesterday once I changed my metadata from a csv to a jsonl file it just worked
