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 section Training on a minimised data set #4

Open
hibakhanam opened this issue Jun 4, 2018 · 1 comment
Open

Error in section Training on a minimised data set #4

hibakhanam opened this issue Jun 4, 2018 · 1 comment

Comments

@hibakhanam
Copy link

hibakhanam commented Jun 4, 2018

Hi,
i am trying 3-us8k-cnn-extract-train but met with error at the section "Training on a minimised data set". hope you will help me to get out of this
this is what i got

fold1 features: (0, 60, 41, 2)
fold2 features: (0, 60, 41, 2)
fold3 features: (0, 60, 41, 2)
Building model...
Training model...

ValueError Traceback (most recent call last)
in ()
18 # now fit the model to the training data, evaluating loss against the validation data
19 print("Training model...")
---> 20 model.fit(train_x, train_y, validation_data=(valid_x, valid_y), callbacks=[earlystop], batch_size=20, epochs=3)
21
22 # now evaluate the trained model against the unseen test data
~\Anaconda3\lib\site-packages\keras\models.py in fit(self, x, y, batch_size, epochs, verbose, callbacks, validation_split, validation_data, shuffle, class_weight, sample_weight, initial_epoch, steps_per_epoch, validation_steps, **kwargs)
1000 initial_epoch=initial_epoch,
1001 steps_per_epoch=steps_per_epoch,
-> 1002 validation_steps=validation_steps)
1003
1004 def evaluate(self, x=None, y=None,
~\Anaconda3\lib\site-packages\keras\engine\training.py in fit(self, x, y, batch_size, epochs, verbose, callbacks, validation_split, validation_data, shuffle, class_weight, sample_weight, initial_epoch, steps_per_epoch, validation_steps, **kwargs)
1628 sample_weight=sample_weight,
1629 class_weight=class_weight,
-> 1630 batch_size=batch_size)
1631 # Prepare validation data.
1632 do_validation = False
~\Anaconda3\lib\site-packages\keras\engine\training.py in _standardize_user_data(self, x, y, sample_weight, class_weight, check_array_lengths, batch_size)
1478 output_shapes,
1479 check_batch_axis=False,
-> 1480 exception_prefix='target')
1481 sample_weights = _standardize_sample_weights(sample_weight,
1482 self._feed_output_names)
~\Anaconda3\lib\site-packages\keras\engine\training.py in _standardize_input_data(data, names, shapes, check_batch_axis, exception_prefix)
121 ': expected ' + names[i] + ' to have shape ' +
122 str(shape) + ' but got array with shape ' +
--> 123 str(data_shape))
124 return data
125
ValueError: Error when checking target: expected activation_4 to have shape (10,) but got array with shape (0,)

and it is craeting problem in later sections

@StanSilas
Copy link

I fixed it. I'll make a merge request.

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