作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
使用 tensorflow 时,出现以下错误消息
ERROR:root:Internal Python error in the inspect module.
Below is the traceback from this internal error.'
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 965, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'tensorflow_core.estimator'
已安装的 tensorflow 相关包如下所示。我需要更新估算器的版本吗?如果是这种情况,如何安装正确版本的估算器?
最佳答案
TL;DR:通过确保 tensorflow
解决了这个问题和 tensorflow-estimator
在同一个版本中。 (就我而言,我需要降级 tensorflow-estimator
,所以 conda install tensorflow-estimator=2.1.0
为我解决了)
您可能已经注意到,有些 tensorflow
版本在某些 GPU 上运行不佳,因此我会首先使用 conda search tensorflow
检查一些可用的版本;那么我会确保选择的 tensorflow
build 实际上可以识别我的 GPU(使用 tf.config.list_physical_devices('GPU')
);最后,我会搜索匹配的 tensorflow-estimator
使用 conda search tensorflow-estimator
构建然后才用 conda install tensorflow-estimator=<chosen version> -n <my_venv>
安装它.
但是,应该注意的是,如果您对使用 GPU 感兴趣,所有这些步骤都非常有用。如果不是这种情况,那么升级两个软件包(或降级/升级它们以使其版本匹配)可能是一种方法。
关于tensorflow - ModuleNotFoundError : No module named 'tensorflow_core.estimator' for tensorflow 2. 1.0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66022256/
我是一名优秀的程序员,十分优秀!