0

I'm currently tinker with a GAN and am using the dataset Safebooru. In the repository I'm getting this code there is a download zip which contains.

all_data.csv

The csv contains the columns:

id,created_at,rating,score,sample_url,sample_width,sample_height,preview_url,tags

And all it's associated data. I attempt to import the data like so:

import torch
from torch.utils.data import DataLoader
from torchvision.datasets import ImageFolder

then the original code has the zip extracting:

!mkdir cartoons
!mkdir cartoons/1
!unzip -n -q /content/data/My\ Drive/cartoonGAN/safebooru.zip -d cartoons/1/ #extract to subfolder due to DataLoader needs subdirectories

then I try to check the ImageFolder

cartoon_dataset = ImageFolder('cartoons/', transformer)

This kicks out an error that the file is not found:

FileNotFoundError: Found no valid file for the classes 1. Supported extensions are: .jpg, .jpeg, .png, .ppm, .bmp, .pgm, .tif, .tiff, .webp

I found this error referenced here but it does not help. .ipynb_checkpoints this does not exists in my directory (I checked).

Any idea why this happens? Am I supposed to actually download the physical images and have them in the specified directory

FabricioG
  • 3,107
  • 6
  • 35
  • 74
  • This isn't noted in your question, but a `.csv` file is not in the allowed extension types as noted in your error. What is the contents of your `cartoons` dir? Have you tried loading the contents of the lines for `sample_url` as i'd imagine these have the correct extension to not throw the error? – ViaTech Nov 25 '22 at 21:17
  • cartoons directory only contains directory 1 which is created in original code (just added it). It does extract the contents. Do I need to extract the contents of the images? @ViaTech – FabricioG Nov 25 '22 at 21:22

0 Answers0