1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

[Python] Error: ValueError: Must provide at least one structure

Discussão em 'Python' iniciado por Stack, Setembro 14, 2024.

  1. Stack

    Stack Membro Participativo

    During executing below code:

    train_generator = train_datagen.flow_from_directory(
    directory=r'./train/',
    target_size=(224, 224),
    classes=['hot_dog','not_hot_dog'],
    class_mode='categorical',
    batch_size=batch_size,
    shuffle=True,
    seed=42)

    valid_generator = valid_datagen.flow_from_directory(
    directory=r'./test/',
    target_size=(224, 224),
    classes=['hot_dog','not_hot_dog'],
    class_mode='categorical',
    batch_size=batch_size,
    shuffle=True,
    seed=42)

    model.fit(train_generator, steps_per_epoch=15,
    epochs=16, validation_data=valid_generator,
    validation_steps=15)


    I have an error

    ValueError: Must provide at least one structure

    Also there is message like below, so I assume it does not see images in the folders

    Found 0 images belonging to 2 classes.


    I tried to change directory path to

    directory=./train/'

    or

    directory=/train/'

    but it did not help. Folders are placed where the python file with code. I also found advise that there must be at least 8 images but in those folders there are hundreds so this is not the case. I added subset tagging intro training and vaidation and this is also not a case. The same error. All images are dowloaded from kaggle as completed dataset

    Continue reading...

Compartilhe esta Página