Categories
Artificial Intelligence (AI) Development

Keras fit generator – ValueError: Failed to find data adapter that can handle input

I’m trying to fit my deep learning model with a custom generator.

When i fit the model, it shows me this error:
enter image description here

I tried to find similar questions, but all the answers were about converting lists to numpy array. I think that’s not the question in this error. My lists are all in numpy array format. This custom generator is based on a custom generator from here

This is the part of code where I fit the model:
on

where the variables are:

  • representations_path – is a string with the directory to the path where i store the training files, that which file is the input to model
  • target_path – is a string with the directory to the path where i store the target files, that which file is the target of the model (output)
  • training_filenames – is a list with the names of training and target files (both have the same name, but they are in different folders)
  • batch_size – integer with the size of the batch. It has the value 7.

My generator class is below:
enter image description here

How can I fix this error?

Thank you mates!

One reply on “Keras fit generator – ValueError: Failed to find data adapter that can handle input”

Leave a Reply

Your email address will not be published. Required fields are marked *