TypeError: Input 'shape' of 'ScatterNd' Op has type int64 that does not match type int32 of argument 'indices'.

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

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
需要澄清
活跃度
停滞
技术栈
python

调研方向

从 graphics/reconstruct_geometry.py 开始,沿着 Local Implicit 示例进入 core/reconstruction.py,重点查看第 106 行的 LIGOptimizer._init_graph,其中 tf.scatter_nd 会失败。复现示例中的潜在网格优化,并检查索引和 shape 输入的 dtypes。完成标准是重建过程能够继续执行并越过此 ScatterNd 错误。

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

描述

Trying to test Local Implicit sample I've found this issue:


Performing latent grid optimization...
Traceback (most recent call last):
  File "C:\Users\Victor\anaconda3\envs\LocalImplicit\lib\site-packages\tensorflow\python\framework\op_def_library.py", line 508, in _apply_op_helper
    values = ops.convert_to_tensor(
  File "C:\Users\Victor\anaconda3\envs\LocalImplicit\lib\site-packages\tensorflow\python\profiler\trace.py", line 183, in wrapped
    return func(*args, **kwargs)
  File "C:\Users\Victor\anaconda3\envs\LocalImplicit\lib\site-packages\tensorflow\python\framework\ops.py", line 1662, in convert_to_tensor
    raise ValueError(
ValueError: Tensor conversion requested dtype int32 for Tensor with dtype int64: <tf.Tensor 'Const_3:0' shape=(2,) dtype=int64>

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\Dependencias\LocalImplicitGrid\graphics\reconstruct_geometry.py", line 108, in <module>
    app.run(main)
  File "C:\Users\Victor\anaconda3\envs\LocalImplicit\lib\site-packages\absl\app.py", line 312, in run
    _run_main(main, args)
  File "C:\Users\Victor\anaconda3\envs\LocalImplicit\lib\site-packages\absl\app.py", line 258, in _run_main
    sys.exit(main(argv))
  File "D:\Dependencias\LocalImplicitGrid\graphics\reconstruct_geometry.py", line 88, in main
    v, f, _, _ = rec.encode_decoder_one_scene(
  File "D:\Dependencias\LocalImplicitGrid\graphics\tensorflow_graphics\projects\local_implicit_grid\core\reconstruction.py", line 351, in encode_decoder_one_scene
    goptim = LIGOptimizer(
  File "D:\Dependencias\LocalImplicitGrid\graphics\tensorflow_graphics\projects\local_implicit_grid\core\reconstruction.py", line 61, in __init__
    self._init_graph()
  File "D:\Dependencias\LocalImplicitGrid\graphics\tensorflow_graphics\projects\local_implicit_grid\core\reconstruction.py", line 106, in _init_graph
    self.feat_grid = tf.scatter_nd(self.occ_idx_flat_,
  File "C:\Users\Victor\anaconda3\envs\LocalImplicit\lib\site-packages\tensorflow\python\ops\gen_array_ops.py", line 9185, in scatter_nd
    _, _, _op, _outputs = _op_def_library._apply_op_helper(
  File "C:\Users\Victor\anaconda3\envs\LocalImplicit\lib\site-packages\tensorflow\python\framework\op_def_library.py", line 546, in _apply_op_helper
    raise TypeError(
TypeError: Input 'shape' of 'ScatterNd' Op has type int64 that does not match type int32 of argument 'indices'.

Any tip on this?

Thank you in advance.

主要语言
Python
星标
2.8k
派生
374
平均合并
5 天 9 小时
30 天内合并 PR
1

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

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

tensorflow/graphics 的其他 Issue

查看 tensorflow/graphics 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

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