tensorflow / tensorflow/java

NameScope interacts poorly with subscoping

Open
#413 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
928
Forks
227
PR merge metrics
No merged PRs in 30d

Description

System information

  • Have I written custom code (as opposed to using a stock example script provided in TensorFlow): Yes
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04 x86_64): macOS x86_64
  • TensorFlow installed from (source or binary): source
  • TensorFlow version (use command below): 0.5.0-SNAPSHOT
  • Java version (i.e., the output of java -version): JDK 11

Describe the current behavior
I'm trying to debug test failures in tensorflow-framework, and noticed that the test sessions use tf = Ops.create(graph).withName("test");. This makes all the nodes have the name "test_" which makes things pretty tricky to debug. I changed it to tf = Ops.create(graph).withSubScope("test");, but now I'm getting test failures out of the optimizers with the following message:

[INFO] Running org.tensorflow.framework.optimizers.FtrlTest
[ERROR] Tests run: 5, Failures: 0, Errors: 4, Skipped: 0, Time elapsed: 0.455 s <<< FAILURE! - in org.tensorflow.framework.optimizers.FtrlTest
[ERROR] testFtrlWithL1  Time elapsed: 0.415 s  <<< ERROR!
java.lang.IllegalArgumentException: invalid name: 'test/var0_gradient_accumulator' does not match the regular expression [A-Za-z0-9.][A-Za-z0-9_.\-]*
	at org.tensorflow.framework.optimizers.FtrlTest.testFtrlWithL1(FtrlTest.java:166)

Describe the expected behavior

No test failures, and test nodes have the correct op names.

Code to reproduce the issue
Make the withSubScope change at line 44 in org.tensorflow.framework.utils.GraphTestSession.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at line 44 of tensorflow-framework's GraphTestSession and compare the behavior of Ops.withName("test") and Ops.withSubScope("test"). Reproduce the failure in FtrlTest.testFtrlWithL1 at line 166, then inspect the generated name and the name validation involved. Done means the optimizer tests pass and test nodes retain debuggable, valid op names.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, tensorflow
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.