---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
<ipython-input-1-5f7a0f1d2a10> in <module>()
8
9 bn = keras.layers.BatchNormalization(axis=-1)
---> 10 y_training = bn(x, training=True)
11 y_inference = bn(x, training=False)
~\Anaconda3\lib\site-packages\tensorflow\python\keras\_impl\keras\engine\topology.py in __call__(self, inputs, **kwargs)
256 """
257 # Actually call the layer (optionally building it).
--> 258 output = super(Layer, self).__call__(inputs, **kwargs)
259 if context.in_eager_mode():
260 return output
~\Anaconda3\lib\site-packages\tensorflow\python\layers\base.py in __call__(self, inputs, *args, **kwargs)
650
651 if not in_deferred_mode:
--> 652 outputs = self.call(inputs, *args, **kwargs)
653 if outputs is None:
654 raise ValueError('A layer\'s `call` method should return a Tensor '
~\Anaconda3\lib\site-packages\tensorflow\python\keras\_impl\keras\layers\normalization.py in call(self, inputs, training)
109 training = K.learning_phase()
110 output = super(BatchNormalization, self).call(inputs, training=training)
--> 111 if training is K.learning_phase():
112 output._uses_learning_phase = True # pylint: disable=protected-access
113 return output
~\Anaconda3\lib\site-packages\tensorflow\python\keras\_impl\keras\backend.py in learning_phase()
329 graph = ops.get_default_graph()
330 if graph not in _GRAPH_LEARNING_PHASES:
--> 331 phase = array_ops.placeholder(dtype='bool', name='keras_learning_phase')
332 _GRAPH_LEARNING_PHASES[graph] = phase
333 return _GRAPH_LEARNING_PHASES[graph]
~\Anaconda3\lib\site-packages\tensorflow\python\ops\array_ops.py in placeholder(dtype, shape, name)
1675 """
1676 if context.in_eager_mode():
-> 1677 raise RuntimeError("tf.placeholder() is not compatible with "
1678 "eager execution.")
1679
RuntimeError: tf.placeholder() is not compatible with eager execution.