Allen More
Allen More

Reputation: 908

What are the constraints for tensorflow scope names?

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 tensorflow 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?

Upvotes: 27

Views: 19871

Answers (2)

jaihind yadav
jaihind yadav

Reputation: 21

do not give space between the name example

here name = 'name of model' here you have given space that is why this model gives this error if you put name = 'name_of_model' it will not give you this error

Upvotes: 2

Salvador Dali
Salvador Dali

Reputation: 222771

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)

Upvotes: 29

Related Questions