Skip to content

Commit

Permalink
training.py _check_loss_and_target_compatibility() doesn't crash if y…
Browse files Browse the repository at this point in the history
… is None (#7071)
  • Loading branch information
ahundt authored and fchollet committed Jan 20, 2018
1 parent 8350eb8 commit 1f2e7a7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion keras/engine/training.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ def _check_loss_and_target_compatibility(targets, loss_fns, output_shapes):
losses.binary_crossentropy,
losses.categorical_crossentropy}
for y, loss, shape in zip(targets, loss_fns, output_shapes):
if loss is None:
if y is None or loss is None:
continue
if loss is losses.categorical_crossentropy:
if y.shape[-1] == 1:
Expand Down

0 comments on commit 1f2e7a7

Please sign in to comment.