TFJS突破Python导入并引发了很长的混乱错误

发布于 2025-02-11 20:12:49 字数 4327 浏览 1 评论 0原文

当我导入它时,

2022-06-30 07:54:28.109638: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcudart.so.11.0'; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory
2022-06-30 07:54:28.109660: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/moth/.local/lib/python3.9/site-packages/tensorflowjs/__init__.py", line 21, in <module>
    from tensorflowjs import converters
  File "/home/moth/.local/lib/python3.9/site-packages/tensorflowjs/converters/__init__.py", line 21, in <module>
    from tensorflowjs.converters.converter import convert
  File "/home/moth/.local/lib/python3.9/site-packages/tensorflowjs/converters/converter.py", line 37, in <module>
    from tensorflowjs.converters import tf_saved_model_conversion_v2
  File "/home/moth/.local/lib/python3.9/site-packages/tensorflowjs/converters/tf_saved_model_conversion_v2.py", line 42, in <module>
    import tensorflow_hub as hub
  File "/home/moth/.local/lib/python3.9/site-packages/tensorflow_hub/__init__.py", line 88, in <module>
    from tensorflow_hub.estimator import LatestModuleExporter
  File "/home/moth/.local/lib/python3.9/site-packages/tensorflow_hub/estimator.py", line 62, in <module>
    class LatestModuleExporter(tf.compat.v1.estimator.Exporter):
  File "/home/moth/.local/lib/python3.9/site-packages/tensorflow/python/util/lazy_loader.py", line 58, in __getattr__
    module = self._load()
  File "/home/moth/.local/lib/python3.9/site-packages/tensorflow/python/util/lazy_loader.py", line 41, in _load
    module = importlib.import_module(self.__name__)
  File "/usr/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "/home/moth/.local/lib/python3.9/site-packages/tensorflow_estimator/__init__.py", line 8, in <module>
    from tensorflow_estimator._api.v1 import estimator
  File "/home/moth/.local/lib/python3.9/site-packages/tensorflow_estimator/_api/v1/estimator/__init__.py", line 8, in <module>
    from tensorflow_estimator._api.v1.estimator import experimental
  File "/home/moth/.local/lib/python3.9/site-packages/tensorflow_estimator/_api/v1/estimator/experimental/__init__.py", line 8, in <module>
    from tensorflow_estimator.python.estimator.canned.dnn import dnn_logit_fn_builder
  File "/home/moth/.local/lib/python3.9/site-packages/tensorflow_estimator/python/estimator/canned/dnn.py", line 27, in <module>
    from tensorflow_estimator.python.estimator import estimator
  File "/home/moth/.local/lib/python3.9/site-packages/tensorflow_estimator/python/estimator/estimator.py", line 31, in <module>
    from tensorflow.python.checkpoint import checkpoint as trackable_util
  File "/home/moth/.local/lib/python3.9/site-packages/tensorflow/python/checkpoint/checkpoint.py", line 32, in <module>
    from tensorflow.python.checkpoint import graph_view as graph_view_lib
  File "/home/moth/.local/lib/python3.9/site-packages/tensorflow/python/checkpoint/graph_view.py", line 19, in <module>
    from tensorflow.python.checkpoint import trackable_view
  File "/home/moth/.local/lib/python3.9/site-packages/tensorflow/python/checkpoint/trackable_view.py", line 20, in <module>
    from tensorflow.python.trackable import converter
  File "/home/moth/.local/lib/python3.9/site-packages/tensorflow/python/trackable/converter.py", line 23, in <module>
    from tensorflow.python.trackable import data_structures
  File "/home/moth/.local/lib/python3.9/site-packages/tensorflow/python/trackable/data_structures.py", line 1103, in <module>
    revived_types.register_revived_type(
  File "/home/moth/.local/lib/python3.9/site-packages/tensorflow/python/saved_model/revived_types.py", line 133, in register_revived_type
    raise AssertionError(f"Duplicate registrations for type '{identifier}'")
AssertionError: Duplicate registrations for type 'trackable_dict_wrapper'
>>> 

我不知道发生了什么。 我使用Gentoo Linux作为我的操作系统 这是python 3 我在github上提交了一个问题,但没有人 每当我导入它时都会发生这种情况

when I import it it gives

2022-06-30 07:54:28.109638: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcudart.so.11.0'; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory
2022-06-30 07:54:28.109660: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/moth/.local/lib/python3.9/site-packages/tensorflowjs/__init__.py", line 21, in <module>
    from tensorflowjs import converters
  File "/home/moth/.local/lib/python3.9/site-packages/tensorflowjs/converters/__init__.py", line 21, in <module>
    from tensorflowjs.converters.converter import convert
  File "/home/moth/.local/lib/python3.9/site-packages/tensorflowjs/converters/converter.py", line 37, in <module>
    from tensorflowjs.converters import tf_saved_model_conversion_v2
  File "/home/moth/.local/lib/python3.9/site-packages/tensorflowjs/converters/tf_saved_model_conversion_v2.py", line 42, in <module>
    import tensorflow_hub as hub
  File "/home/moth/.local/lib/python3.9/site-packages/tensorflow_hub/__init__.py", line 88, in <module>
    from tensorflow_hub.estimator import LatestModuleExporter
  File "/home/moth/.local/lib/python3.9/site-packages/tensorflow_hub/estimator.py", line 62, in <module>
    class LatestModuleExporter(tf.compat.v1.estimator.Exporter):
  File "/home/moth/.local/lib/python3.9/site-packages/tensorflow/python/util/lazy_loader.py", line 58, in __getattr__
    module = self._load()
  File "/home/moth/.local/lib/python3.9/site-packages/tensorflow/python/util/lazy_loader.py", line 41, in _load
    module = importlib.import_module(self.__name__)
  File "/usr/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "/home/moth/.local/lib/python3.9/site-packages/tensorflow_estimator/__init__.py", line 8, in <module>
    from tensorflow_estimator._api.v1 import estimator
  File "/home/moth/.local/lib/python3.9/site-packages/tensorflow_estimator/_api/v1/estimator/__init__.py", line 8, in <module>
    from tensorflow_estimator._api.v1.estimator import experimental
  File "/home/moth/.local/lib/python3.9/site-packages/tensorflow_estimator/_api/v1/estimator/experimental/__init__.py", line 8, in <module>
    from tensorflow_estimator.python.estimator.canned.dnn import dnn_logit_fn_builder
  File "/home/moth/.local/lib/python3.9/site-packages/tensorflow_estimator/python/estimator/canned/dnn.py", line 27, in <module>
    from tensorflow_estimator.python.estimator import estimator
  File "/home/moth/.local/lib/python3.9/site-packages/tensorflow_estimator/python/estimator/estimator.py", line 31, in <module>
    from tensorflow.python.checkpoint import checkpoint as trackable_util
  File "/home/moth/.local/lib/python3.9/site-packages/tensorflow/python/checkpoint/checkpoint.py", line 32, in <module>
    from tensorflow.python.checkpoint import graph_view as graph_view_lib
  File "/home/moth/.local/lib/python3.9/site-packages/tensorflow/python/checkpoint/graph_view.py", line 19, in <module>
    from tensorflow.python.checkpoint import trackable_view
  File "/home/moth/.local/lib/python3.9/site-packages/tensorflow/python/checkpoint/trackable_view.py", line 20, in <module>
    from tensorflow.python.trackable import converter
  File "/home/moth/.local/lib/python3.9/site-packages/tensorflow/python/trackable/converter.py", line 23, in <module>
    from tensorflow.python.trackable import data_structures
  File "/home/moth/.local/lib/python3.9/site-packages/tensorflow/python/trackable/data_structures.py", line 1103, in <module>
    revived_types.register_revived_type(
  File "/home/moth/.local/lib/python3.9/site-packages/tensorflow/python/saved_model/revived_types.py", line 133, in register_revived_type
    raise AssertionError(f"Duplicate registrations for type '{identifier}'")
AssertionError: Duplicate registrations for type 'trackable_dict_wrapper'
>>> 

I don't know what's going on.
I use gentoo linux as my os
this is python 3
I submitted it as an issue on github but no one
responded this happens whenever I import it

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

不疑不惑不回忆 2025-02-18 20:12:49

就我而言,我对tesnsorflow_hub(类型为'trackable_dict_wrapper'的重复注册')遇到了问题。我退化为TensorFlow 2.8.0,PIP安装 - 升级TensorFlow == 2.8.0,错误消失了

In my case I had a problem with tesnsorflow_hub (Duplicate registrations for type 'trackable_dict_wrapper'). I degraded to tensorflow 2.8.0 , pip install --upgrade tensorflow==2.8.0 , and the error disappeared

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文