sitebarter.blogg.se

Data generator tensorflow
Data generator tensorflow









data generator tensorflow

I can also use a smaller sub-dataset with the same data structure and the model runs correctly. However, when I use the correct number data as an input into the model, the model freezes at the second ‘next’ call. I can also see that when fake data is generated, the number data is also getting generated. When I generate a random list of numbers, the model runs perfectly. I’ve checked that the data is in the right format, the right length, and matching properly to the other input. When I run this model, the output freezes at ‘Epoch 1/12’. Validation_steps=int(len(validation_df) / batch_size), Steps_per_epoch=int(len(train_df) / batch_size), Numberdata = np.asarray(numberdata).astype(np.int32) Dataset tf.data.Dataset TensorFlow Core v2.8.0 ( tf.data.Dataset TensorFlow Core v2.8.0 ). You can find this here in the link: Second, I went through tf.data.

#Data generator tensorflow code#

#this code never works, the model freezes One of the solutions is a custom data generator with Keras. Outputdata = np.asarray(outputdata).astype('float32')

data generator tensorflow

Number_labels = np.random.randint(1,219,len(data_batch)) The relevant code is as follows, where y_col is the output, number_col is the associated number and path_col is the path to the images: # data generatorĭf_gen = img_data_gen.flow_from_dataframe(Ĭlass_mode=‘raw’) sending data to model, wrapped in a larger functionĭata_batch = next(df_gen) #fake data, works in the model perfectly Later on, I switch one of the outputs into an input and feed it into the model. I’ve tried two different custom data generators, but the simpler one merely uses ImageDataGenerator and flowfromdataframe with two outputs. The inputs are in the form of an image and an associated number. I’ve been trying to get a multi-input data generator to work in Keras for a muti-input model. Stackoverflow link: python - Keras Custom Data Generator - Stuck on First Epoch, No Output? - Stack Overflow











Data generator tensorflow