Questions tagged [imagedatagenerator]

63 questions
8
votes
2 answers

How to split folders to 3 datasets with ImageDataGenerator?

validation_split parameter is able to allow ImageDataGenerator to split the data sets reading from the folder into 2 different disjoint sets. Is there any way to create 3 sets - of training, validation, and evaluation datasets using it? I am…
zs2020
  • 53,766
  • 29
  • 154
  • 219
3
votes
0 answers

Unexpected result of `train_function` (Empty logs). Please use `Model.compile(..., run_eagerly=True)

when i run model.fit i get the following error : Unexpected result of train_function (Empty logs). Please use Model.compile(..., run_eagerly=True), or tf.config.run_functions_eagerly(True) for more information of where went wrong, or file a…
2
votes
0 answers

For test_datagen.flow from directory, what should I specify the class_mode?

I'm attempting to create a CNN model using image data. My entire data set was divided into train, test, and validation. I used class_mode = 'categorical' for the training data since training data needs labels, and class_mode = None for the test data…
Rezuana Haque
  • 608
  • 4
  • 14
1
vote
0 answers

Setting up a data generator for learning a hidden layer

Long time lurker, first-time poster here :) I am trying to build a CNN in python that will take as input an image and output 25 continuous values predicted from said image. I have a directory containing subdirectories each with the image as a .jpg…
sbudoff
  • 11
  • 1
1
vote
1 answer

is the .classes method of a imagedatagenorator sorted?

anyone know if i am doing this right, basically i am trying to create a CM, i have got my y_pred and obviously i need my ground truths, or this i am trying to use testdata.classes (this is what they do online, testdata is an instance of…
1
vote
1 answer

How can I create a custom data generator for multiple inputs using keras ( tf.keras.utils.Sequence )?

The model takes four inputs and gives one output. Among those four inputs two is numerical data, one is categorical and another one is image. The output is binary (0 or 1). I need to create a custom data generator which can take those inputs from…
1
vote
0 answers

How to save file adding previous name as prefix after ImageDataGenerator

Using ImageDataGenerator of Keras. suppose my folder structure is like a - 1.jpg 2.jpg 3.jpg b - 5.jpg 6.jpg 7.jpg I am doing the augmentation like below : for i in range (20): for label in LABELS: # "LABELS" is the folder name…
1
vote
0 answers

Use ResNet50 with greyscale images

I'm trying to train a ResNet50 model with grayscale images. Since I need the data augmentation functionality of the ImageDataGenerator, I have to implement the logic in to the preprocessing_function. But I run into an error for the following…
surtr
  • 65
  • 3
1
vote
2 answers

Duplicate Widget ID: streamlit

I am getting this error: DuplicateWidgetID: There are multiple identical st.button widgets with key='1'. To fix this, please make sure that the key argument is unique for each st.button you create. how can I solve this def Breccia_Predictions(): …
Taiwo
  • 65
  • 8
1
vote
1 answer

Error when running ImageDataGenerator.next() code

I am currently running python 3.8.6, and when running the following code from https://machinelearningmastery.com/how-to-configure-image-data-augmentation-when-training-deep-learning-neural-networks/ I get an error saying that scipy is not defined. #…
1
vote
1 answer

A custom Image DataGen for stacked denoising autoencoder (DAE) in Keras on GPU (exceptions)

Have you ever created a custom ImageDataGenerator for Keras? For one of our projects we have already created two sets of "clean images" and multiple noisy versions of each one as the "noisy images", in two folders. I want to design and train an…
Moein
  • 739
  • 2
  • 9
  • 17
0
votes
0 answers

Is there a method to yield numpy arrays from image_dataset_from_directory()?

I'm modifying the example from Keras (https://keras.io/examples/vision/semantic_image_clustering/#selfsupervised-representation-learning) with a custom dataset. Their example uses np arrays for the training and test data. So far, I've been able to…
vmchance
  • 1
  • 1
0
votes
0 answers

Why is shuffle False in the test imagedatagenerator?

I am using a classification model that classifies normal and abnormal in binary through imagedatagenerator. Training and validation generators have been performed and model training has performed well. However, a question arose in the test…
0
votes
0 answers

keras flow_from_directory returns missing images

I have a problem about number of images in my python code. I use splitfolders for splitting images data to folder. There is missing images between number of images in this folder to number of images found by flow_from_directory libs Hi. First i…
0
votes
0 answers

ImageDataGenerator is turning all of my RGB pixels to 0

I am creating images using PIL based on arrays of size 20000 pixels wide and 1 pixel high, these pixels are coded with RGB values. However, once saved to my computer and processed using ImageDataGenerator, all RGB values are turned to 0. I do not…
1
2 3 4 5