python - 属性错误: module 'tensorflow.python.pywrap_tensorflow' has no attribute 'TFE_Py_RegisterExceptionClass'

标签 python tensorflow machine-learning time-series recurrent-neural-network

我正在尝试使用最新的可用资源来开发一些时间序列序列预测。为此,我确实检查了 TensorFlow 时间序列中的示例代码,但收到此错误:

AttributeError: module 'tensorflow.python.pywrap_tensorflow' has no attribute 'TFE_Py_RegisterExceptionClass'

我正在使用 Anaconda。当前环境是Python 3.5和TensorFlow 1.2.1。也尝试过 TensorFlow 1.3,但没有任何改变。

这里是the code I'm trying to run 。我在谷歌上没有找到与该问题相关的任何有用信息。有什么解决办法吗?

最佳答案

正如 Conan.Net 所写:

I tried to remove/clean some environments from anaconda and install all again and it work this time.

这个解决方案也对我有用,所以虽然不理想,但它可以解决问题。如果您使用 anaconda,则在安装某些软件包然后删除它们(例如,tensorflow 与 tensorflow-gpu)时可能会发生这种情况,从而导致某些依赖项悬而未决。就我而言,我使用了:

conda remove --name py2_tf_gpu --all

然后

conda create --name py2_tf_gpu python=2 anaconda pandas numpy scipy jupyter 
source activate py2_tf_gpu
pip install --ignore-installed --upgrade tensorflow-gpu

pip 目前安装了比 anaconda(1.3) 更高的版本 (1.4),我需要它。

关于python - 属性错误: module 'tensorflow.python.pywrap_tensorflow' has no attribute 'TFE_Py_RegisterExceptionClass' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46010571/

相关文章:

machine-learning - 如何在我的 PC 上保存机器学习模型集合?

matlab - 线性判别分析matlab

python - Paramiko SSHClient无法在远程计算机上执行整个shell脚本

python - 如何在 Python 中进行多元回归分析?

Tensorflow:GPU 识别不一致

tensorflow - 如何在Keras模型中替换(或插入)中间层?

python - 使python默认用字符串替换不可编码的字符

python - boto3 - 获取 boto3 中特定方法所需的所有 API 调用

python - HTTP基本认证,使用python

python - 如何在 scikit TfidfVectorizer 中为专有名词赋予更多权重