【发布时间】:2021-12-26 09:30:15
【问题描述】:
环境是 Mac M1 和带有 python3.8 的 miniforge Conda。我已经完成了以下命令来安装 tensorflow 和 tensorflow_hub:
conda install -c apple tensorflow-deps
pip install tensorflow-macos
pip install tensorflow-metal
# tried all the conda commands here (https://anaconda.org/conda-forge/tensorflow-hub) and the following
pip install tensorflow_hub
在 Jupyter Notebook 上导入 tensorflow_hub 时出现以下错误:
cannot import name 'LinearSDCA' from partially initialized module
'tensorflow_estimator.python.estimator.canned.linear' (most likely due to a circular import)
(/myenv/lib/python3.8/site-packages/tensorflow_estimator/python/estimator/canned/linear.py)
使用终端导入tensorflow_hub时,报错信息为:
E tensorflow/core/lib/monitoring/collection_registry.cc:77] Cannot register 2 metrics with the same name: /tensorflow/api/keras/optimizers
...Traceback...
self._metric = self._metric_methods[self._label_length].create(*args)
tensorflow.python.framework.errors_impl.AlreadyExistsError: Another metric with the same name already exists.
目前我的tensorflow_estimator的版本是2.6.0,tensorflow_hub的版本是0.12.0。我尝试更改 tensorflow_estimator 的版本。但是,我能够安装且没有错误的唯一 tensorflow-macos 版本是 2.6.0,它需要 tensorflow_estimator 2.6.0。感谢您的时间和您可以提供的任何帮助。
【问题讨论】:
标签: python tensorflow jupyter-notebook conda tensorflow-hub