Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the constraints for tensorflow scope names?

Tags:

I'm running a tensorflow model and getting the following error:

ValueError: 'Cement (component 1)(kg in a m^3 mixture)' is not a valid scope name.

I get that tf probably doesn't like special chars and spaces in its scope names, but I'm trying to find an actual doc on what chars are allowed. Does anyone know where I could find this?

Thanks.

like image 567
Allen More Avatar asked Jun 20 '17 22:06

Allen More


People also ask

What is name scope in TensorFlow?

Graph-based Neural Structured Learning in TFX. This context manager pushes a name scope, which will make the name of all operations added within it have a prefix. For example, to define a new Python op called my_op : def my_op(a, b, c, name=None): with tf.

What is TF variable scope?

Variable scope allows you to create new variables and to share already created ones while providing checks to not create or share by accident. For details, see the Variable Scope How To, here we present only a few basic examples. The Variable Scope works as expected when the Eager Execution is Disabled. tf. compat.


1 Answers

From the TF source:

NOTE: This constructor validates the given name. Valid scope

names match one of the following regular expressions:

[A-Za-z0-9.][A-Za-z0-9_.\\-/]* (for scopes at the root) [A-Za-z0-9_.\\-/]* (for other scopes) 
like image 190
Salvador Dali Avatar answered Oct 01 '22 10:10

Salvador Dali