How to manually specify class labels in keras flow_from_directory?

前端 未结 3 1089
不知归路
不知归路 2021-02-01 19:38

Problem: I am training a model for multilabel image recognition. My images are therefore associated with multiple y labels. This is conflicting with the conveni

3条回答
  •  走了就别回头了
    2021-02-01 19:55

    # Training the model
    history = model.fit(train_generator, steps_per_epoch=steps_per_epoch, epochs=3, validation_data=val_generator,validation_steps=validation_steps, verbose=1,
                        callbacks= keras.callbacks.ModelCheckpoint(filepath='/content/results',monitor='val_accuracy', save_best_only=True,save_weights_only=False))
    

    The validation_steps or the steps_per_epoch might be exceeding than that of the original parameters.

    steps_per_epoch= (int(num_of_training_examples/batch_size) might help. Similarly validation_steps= (int(num_of_val_examples/batch_size) will help

提交回复
热议问题