`tensorflow_graphics.shape.check_static(...)` throwing error in TF2
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 42/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- python, tensorflow
调研方向
首先,使用报告中的 RandomRot 层和 Dataset 用法重现 TensorFlow 2 在 graph-mode 下的失败。阅读 tensorflow_graphics/geometry/transformation/rotation_matrix_3d.py 中 from_euler 附近的代码,以及 tensorflow_graphics/util/shape.py 中 check_static 和 _get_dim 附近的代码;当同一图编译路径不再引发报告的 AttributeError 时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
I was writing a data augmentation layer for a PointNet implementation and ran into what appears to be a bug in tensorflow_graphics.shape.check_static(...), as seen on this line.
Offending layer:
class RandomRot(Layer):
def __init__(self):
super(RandomRot, self).__init__()
def build(self, input_shape):
self.s = tf.constant([input_shape[-1],])
def call(self, inputs, training=None):
if not training: return inputs
r = tf.random.uniform(
shape=self.s,
minval=0,
maxval=6.28,
)
return tf.linalg.matmul(inputs,from_euler(r))
Error message:
AttributeError: in user code:
<ipython-input-135-d11754641da6>:81 call *
self.x = self.r(self.x,training)
<ipython-input-130-07bfe7ac5ab9>:25 call *
return tf.linalg.matmul(inputs,from_euler(r))
/usr/local/lib/python3.6/dist-packages/tensorflow_graphics/geometry/transformation/rotation_matrix_3d.py:201 from_euler *
shape.check_static(
/usr/local/lib/python3.6/dist-packages/tensorflow_graphics/util/shape.py:206 check_static *
if _get_dim(tensor, axis) != value:
/usr/local/lib/python3.6/dist-packages/tensorflow_graphics/util/shape.py:135 _get_dim *
return tensor.shape[axis].value
AttributeError: 'int' object has no attribute 'value'
It appears that check_static is expecting each element from .shape to be a tensor, but in TF2 they're just ints. If I comment out check_static from from_euler, the function works fine. Strangely enough, it seems to work fine for tensors in eager execution, and only seems to throw errors when using Dataset objects with graph compilation.
- 主要语言
- Python
- 星标
- 2.8k
- 派生
- 374
- 平均合并
- 5 天 9 小时
- 30 天内合并 PR
- 1
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
tensorflow/graphics 的其他 Issue
-
难度 1/5 1 小时以内 新手友好度 62/100
tensorflow/graphics#468 ·
-
难度 5/5 一周以上 新手友好度 25/100
tensorflow/graphics#5337 ·
-
难度 3/5 1-2 天 新手友好度 25/100
tensorflow/graphics#730 ·
-
难度 4/5 3-5 天 新手友好度 35/100
tensorflow/graphics#729 ·
-
难度 5/5 一周以上 新手友好度 10/100
tensorflow/graphics#724 ·
查看 tensorflow/graphics 的全部 Issue
相似的 Issue
-
`destroy` sans terminal répond « Aborted. » au lieu de réclamer `--yes` comme `clean` et `reset`未关闭bug
难度 2/5 1-3 小时 新手友好度 85/100
stephrobert/dsoxlab#354 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 77/100
jasonacox/pypowerwall#472 ·
维护者通常 1 天内回复
-
[Bug]: DoubleMLRDDData accepts a score_col that is no data column (as in its docstring example); the running variable then becomes a covariate and RDFlex fails可能已有人在做 @vrjdev 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
DoubleML/doubleml-for-py#455 ·
维护者通常 1 天内回复
-
[Bug]: Python mod.Box[T] annotation gets a false generic_arg edge that replaces the parameter_type one ('is' on tree-sitter nodes)可能已有人在做 @rohit-jsfreaky 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 88/100
Graphify-Labs/graphify#5110 · 1 条评论 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
assafelovic/gpt-researcher#2277 ·
维护者通常 10 天内回复