Make sure the name of the learning phase in TF does not depend on outer name scopes.
@@ -95,7 +95,9 @@ def clear_session():
tf.reset_default_graph()
reset_uids()
_SESSION = None
- phase = tf.placeholder_with_default(False,
+ with tf.name_scope(''):
+ phase = tf.placeholder_with_default(
+ False,
shape=(),
name='keras_learning_phase')
_GRAPH_LEARNING_PHASES = {}
@@ -130,7 +132,9 @@ def learning_phase():
"""
graph = tf.get_default_graph()
if graph not in _GRAPH_LEARNING_PHASES:
- phase = tf.placeholder_with_default(False,
+ with tf.name_scope(''):
+ phase = tf.placeholder_with_default(
+ False,
shape=(),
name='keras_learning_phase')
_GRAPH_LEARNING_PHASES[graph] = phase
