tensorflow - How to add all variables under a scope into a certain collection -


in tensorflow python apis, tf.get_variable has parameter collections add created var specified collections. tf.variable_scope not. what's suggested way add variables under variable scope collection?

i don't believe there way directly. file feature request on tensorflow's github issues tracker.

i can suggest 2 workarounds might try though:

  • iterate on result of tf.all_variables(), , extract variables names ".../scope_name/...". scope names encoded in variable name, separated / characters.

  • write wrappers around tf.variablescope , tf.get_variable() store variables created inside scope in data structure.

i hope helps!


Comments

Popular posts from this blog

.net - Bulk insert via Dapper is slower than inserting rows one-by-one -

shared memory - gstreamer shmsrc and shmsink with h264 data -

java - is not an enclosing class / new Intent Cannot Resolve Constructor -