tensorflow / tensorflow/java

NameScope interacts poorly with subscoping

未关闭
#413 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
Java
星标
928
派生
227
PR 合并指标
30 天内没有已合并 PR

描述

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.

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

从 tensorflow-framework 的 GraphTestSession 第 44 行开始,比较 Ops.withName("test") 和 Ops.withSubScope("test") 的行为。在第 166 行的 FtrlTest.testFtrlWithL1 中复现失败,然后检查生成的名称以及涉及的名称验证。完成标准是优化器测试通过,并且测试节点保留可调试且有效的 Op 名称。

由索引模型根据 Issue 内容生成。

评估

技术栈
java, tensorflow
领域
api, backend
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
42/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。