方法一:在name后面加一个/ with tf.name_scope('hha'): a = tf.zeros(1,name='a') with tf.name_scope('hha/'): b = tf.zeros(1,name='b') print(a.name) print(b.name)