@@ -1518,7 +1518,7 @@ def evaluate(self, x, y, batch_size=32, verbose=1, sample_weight=None):
1518
1518
check_batch_axis = False ,
1519
1519
batch_size = batch_size )
1520
1520
# prepare inputs, delegate logic to _test_loop
1521
- if self .uses_learning_phase and not isinstance (K .learning_phase , int ):
1521
+ if self .uses_learning_phase and not isinstance (K .learning_phase () , int ):
1522
1522
ins = x + y + sample_weights + [0. ]
1523
1523
else :
1524
1524
ins = x + y + sample_weights
@@ -1562,7 +1562,7 @@ def predict(self, x, batch_size=32, verbose=0):
1562
1562
'Batch size: ' + str (batch_size ) + '.' )
1563
1563
1564
1564
# prepare inputs, delegate logic to _predict_loop
1565
- if self .uses_learning_phase and not isinstance (K .learning_phase , int ):
1565
+ if self .uses_learning_phase and not isinstance (K .learning_phase () , int ):
1566
1566
ins = x + [0. ]
1567
1567
else :
1568
1568
ins = x
@@ -1612,7 +1612,7 @@ def train_on_batch(self, x, y,
1612
1612
sample_weight = sample_weight ,
1613
1613
class_weight = class_weight ,
1614
1614
check_batch_axis = True )
1615
- if self .uses_learning_phase and not isinstance (K .learning_phase , int ):
1615
+ if self .uses_learning_phase and not isinstance (K .learning_phase () , int ):
1616
1616
ins = x + y + sample_weights + [1. ]
1617
1617
else :
1618
1618
ins = x + y + sample_weights
@@ -1654,7 +1654,7 @@ def test_on_batch(self, x, y, sample_weight=None):
1654
1654
x , y ,
1655
1655
sample_weight = sample_weight ,
1656
1656
check_batch_axis = True )
1657
- if self .uses_learning_phase and not isinstance (K .learning_phase , int ):
1657
+ if self .uses_learning_phase and not isinstance (K .learning_phase () , int ):
1658
1658
ins = x + y + sample_weights + [0. ]
1659
1659
else :
1660
1660
ins = x + y + sample_weights
@@ -1675,7 +1675,7 @@ def predict_on_batch(self, x):
1675
1675
"""
1676
1676
x = _standardize_input_data (x , self ._feed_input_names ,
1677
1677
self ._feed_input_shapes )
1678
- if self .uses_learning_phase and not isinstance (K .learning_phase , int ):
1678
+ if self .uses_learning_phase and not isinstance (K .learning_phase () , int ):
1679
1679
ins = x + [0. ]
1680
1680
else :
1681
1681
ins = x
0 commit comments