![]() ![]() But when I use the entire dataset, the problem occurs again.ĭo you know what could be causing this problem? I’m using AWS Sagemaker to run the model and can’t seem to figure out where this problem is coming from. 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) #this code never works, the model freezes Outputdata = np.asarray(outputdata).astype('float32') imgdatagen ImageDataGenerator (rescale1./255, preprocessingfunction preprocessingfun) traininggen imgdatagen. 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
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |