回答

0

您可以

my_scope = 'my_scope_name' 
scope_variables= tf.get_collection(tf.GraphKeys.VARIABLES, scope=my_scope) 

得到的變量列表中您的範圍,然後用

init_scope = tf.variables_initializer(scope_variables, name="init_"+my_scope) 
sess.run(init_scope) 
初始化它們