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

qt - QML MouseArea onWheel event not working properly when inside QML Scrollview -

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

python - Error importing VideoFileClip from moviepy : AttributeError: 'PermissionError' object has no attribute 'message' -