Muhammad Rifqi
Muhammad Rifqi

Reputation: 63

Failed to run EfficientNet model to trained 4 class

I'm going to train my model with 4 classes with images.

Here's my pre-trained code look like

conv_base = EfficientNetB0(weights="imagenet", include_top=False,
                                               input_shape=(224, 224, 3))

I trained my mode with code like this:

eff_history = model.fit(
                        train_generator,
                        validation_data=validation_generator,
                        steps_per_epoch=486 // 20,
                        epochs=10)

But there's problem occured like below:

error

Any help guys?

Upvotes: 0

Views: 250

Answers (1)

D. ACAR
D. ACAR

Reputation: 330

You have three labels for each sample, but the last layer of your model outputs 2 classes thus the number of the logits you get is 2 rather than 3. You need to change your model to have a 3 dimensional output.

Upvotes: 1

Related Questions