Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in Using CutMixGenerator #1

Open
younkyul opened this issue Jan 29, 2020 · 1 comment
Open

Error in Using CutMixGenerator #1

younkyul opened this issue Jan 29, 2020 · 1 comment

Comments

@younkyul
Copy link

When I run a simple CNN with CutMixgenerator,

train_gen = CutMixImageDataGenerator(
generator1 = train_generator1,
generator2 = train_generator2,
img_size = image_size,
batch_size = 48,
)
...
model.add(Flatten())
model.add(Dense(2))
model.add(Activation('softmax'))
model.compile(loss='binary_crossentropy', optimizer='adadelta')
model.fit_generator(generator = train_gen, epochs=10, steps_per_epoch=100)

I got an error as follows:

expected activation_5 to have shape (2,) but got array with shape (48,)

Please let me know how to resolve it

@deepakcrk
Copy link

May be its due to you are using binary_crossentropy, if you are using categorical_crossentropy this may be resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants