Skip to content

Commit

Permalink
Fixes #45 (KerasModel with Theano backend) (#46)
Browse files Browse the repository at this point in the history
* fixes shape error in KerasModel #45

* removes changes in test

* fixed flake8
  • Loading branch information
wielandbrendel authored and jonasrauber committed Jul 23, 2017
1 parent acec8d2 commit bca58bc
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion foolbox/models/keras.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def __init__(
elif predicts == 'logits':
predictions_are_logits = True

shape = predictions.get_shape().as_list()
shape = K.int_shape(predictions)
_, num_classes = shape
assert num_classes is not None

Expand Down
1 change: 0 additions & 1 deletion foolbox/tests/test_models_keras.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ def test_keras_model(num_classes):

@pytest.mark.parametrize('num_classes', [10, 1000])
def test_keras_model_probs(num_classes):

bounds = (0, 255)
channels = num_classes

Expand Down

0 comments on commit bca58bc

Please sign in to comment.