tensorflow tfjs在python导入时中断并抛出长的混淆错误

laawzig2  于 2023-02-13  发布在  Python
关注(0)|答案(1)|浏览(303)

当我导入它的时候

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上提交了这个问题,但是没有人回应,每当我导入它时都会发生这种情况

6tqwzwtp

6tqwzwtp1#

在我的例子中,我遇到了tensorflow_hub的问题(类型'trackable_dict_wrapper'的重复注册)。我降级到tensorflow 2.8.0,pip install --upgrade tensorflow==2.8.0,错误消失了

相关问题