python编程之tf.name_scope()的用法

区分对象属于哪个区域的;

python编程之tf.name_scope()的用法

 

python编程之tf.name_scope()的用法 

 

 这个与tf.variable_scope()的区别是什么?

tf.name_scope() 主要是和tf.Variable()使用;

tf.Variable_scope()主要和tf.get_variable()使用;


我们来看看对于tf.Variable(),如果命名重复了,会怎么样?

python编程之tf.name_scope()的用法

 不会冲突,系统会自动改成_1的形式

对于tf.get_variable()呢?会报错

python编程之tf.name_scope()的用法

 

 


在tf.name_scope()中,tf.Variable()会在前缀前面加域名称,但是tf.get_variable()则不会

python编程之tf.name_scope()的用法

 在tf.variable_scope()中,两个都会加域名称

python编程之tf.name_scope()的用法

 

 既然如此,那么用一个就可以了,为什么出来了命名域与变量域?

变量域的影响更大,命名域若有若无

欢迎码友们来讨论这个问题.........