Skip to content

Commit

Permalink
improve error message for malformed validation arguments in fit (kera…
Browse files Browse the repository at this point in the history
…s-team#5141)

* improve error message for incorrect validation arguments

* make formatting consistent per comments in keras-team#5141
  • Loading branch information
davidslac authored and fchollet committed Jan 24, 2017
1 parent aabda13 commit c07d0e6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion keras/engine/training.py
Original file line number Diff line number Diff line change
Expand Up @@ -1124,7 +1124,12 @@ class indices (integers) to
elif len(validation_data) == 3:
val_x, val_y, val_sample_weight = validation_data
else:
raise
raise ValueError('When passing validation_data, '
'it must contain 2 (x_val, y_val) '
'or 3 (x_val, y_val, val_sample_weights) '
'items, however it contains %d items' %
len(validation_data))

val_x, val_y, val_sample_weights = self._standardize_user_data(
val_x, val_y,
sample_weight=val_sample_weight,
Expand Down

0 comments on commit c07d0e6

Please sign in to comment.