ImportError: generic_type: cannot initialize type "StatusCode": an object with that name is already defined
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
从入口点 py::google::ImportStatusModule() 开始,按两种顺序导入 TensorFlow 和 launchpad 以重现故障。跟踪 pybind11 扩展如何初始化 StatusCode;当使用 ImportStatusModule 的软件包可以一起导入且不会出现重复类型导致的 ImportError 时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
Hi,
I am trying to figure out some issues with using the pybind11_abseil.status usage. TensorFlow as well as some other Google projects are using the pybind11_abseil modules. I found that as of TensorFlow 2.14.0 (2.13.1 is fine), it looks like that using TensorFlow in conjunction with packages that use pybind11_abseil will fail with the error
ImportError: generic_type: cannot initialize type "StatusCode": an object with that name is already defined
This happens for example in https://github.com/google-deepmind/launchpad/issues/44 and https://github.com/tensorflow/tflite-support/issues/954. The error happens when a pybind11 extension that uses
py::google::ImportStatusModule() is called.
For example
import tensorflow
import launchpad # Fails when importing an extension that uses ImportStatusModule.
Reversing the order we will see the same issues this time coming from TensorFlow trying to import a module that uses
ImportStatusModule.
I noticed that there are some changes to the pybind11_abseil version used in TensorFlow 2.14.0, which incoporates some changes around the import_status_module, but I don't have a really good clue about what that change entails, it would be quite useful if you can provide some help.
Thanks!
- 主要语言
- C++
- 星标
- 27
- 派生
- 22
- 平均合并
- 19 小时
- 30 天内合并 PR
- 45
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
pybind/pybind11_abseil 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 43/100
pybind/pybind11_abseil#83 ·
维护者通常 1 天内回复
-
CMake linking and install improvements可能重新可做 @Mizux 于 639 天前认领,目前没有进行中的 PR。 未关闭cmake enhancement
pybind/pybind11_abseil#21 · 2 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
Python bindings for absl::Status cause ODR violation可能重新可做 @Mizux 于 401 天前认领,目前没有进行中的 PR。 未关闭bazel bug
pybind/pybind11_abseil#20 · 1 个 reaction · 已指派 1 人 ·
维护者通常 1 天内回复
-
bazel bug
难度 5/5 一周以上 新手友好度 35/100
pybind/pybind11_abseil#18 ·
维护者通常 1 天内回复
-
bug enhancement help wanted
难度 3/5 1-2 天 新手友好度 45/100
pybind/pybind11_abseil#4 · 4 条评论 ·
维护者通常 1 天内回复
查看 pybind/pybind11_abseil 的全部 Issue
相似的 Issue
-
enhancement
难度 2/5 1-3 小时 新手友好度 70/100
raspberrypi/rpi-imager#1804 ·
-
difficulty: easy docs good first issue help wanted
难度 2/5 1-3 小时 新手友好度 74/100
Ryan-Millard/Img2Num#842 ·
维护者通常 12 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
microsoft/calculator#2532 ·
-
难度 2/5 1-3 小时 新手友好度 64/100
-
bug difficulty:easy prio:normal
难度 2/5 1-3 小时 新手友好度 62/100
NatronGitHub/openfx-misc#411 ·
维护者通常 1 天内回复