未找到Windows 10 _gru_ops.dll上的Python Keras安装

时间:2017-06-07 22:59:22

标签: python tensorflow windows-10 keras

我必须在Windows 10上安装带有Tensorflow的Keras。我按照官方网站https://keras.io/#installation上的教程进行操作。

Tensorflow和Keras的安装似乎工作正常但是当我在python终端中导入Keras时我有这个:

>>> import keras
Using TensorFlow backend.
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\Clémence\AppData\Local\Programs\Python\Python35\lib\site-packages\keras\__init__.py", line 3, in <module>
    from . import activations
  File "C:\Users\Clémence\AppData\Local\Programs\Python\Python35\lib\site-packages\keras\activations.py", line 6, in <module>
    from .engine import Layer
  File "C:\Users\Clémence\AppData\Local\Programs\Python\Python35\lib\site-packages\keras\engine\__init__.py", line 8, in <module>
    from .training import Model
  File "C:\Users\Clémence\AppData\Local\Programs\Python\Python35\lib\site-packages\keras\engine\training.py", line 24, in <module>
    from .. import callbacks as cbks
  File "C:\Users\Clémence\AppData\Local\Programs\Python\Python35\lib\site-packages\keras\callbacks.py", line 26, in <module>
    from tensorflow.contrib.tensorboard.plugins import projector
  File "C:\Users\Clémence\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\contrib\__init__.py", line 26, in <module>
    from tensorflow.contrib import crf
  File "C:\Users\Clémence\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\contrib\crf\__init__.py", line 32, in <module>
    from tensorflow.contrib.crf.python.ops.crf import _lengths_to_masks
  File "C:\Users\Clémence\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\contrib\crf\python\ops\crf.py", line 44, in <module>
    from tensorflow.contrib.rnn.python.ops import core_rnn_cell
  File "C:\Users\Clémence\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\contrib\rnn\__init__.py", line 80, in <module>
    from tensorflow.contrib.rnn.python.ops.gru_ops import *
  File "C:\Users\Clémence\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\contrib\rnn\python\ops\gru_ops.py", line 32, in <module>
    resource_loader.get_path_to_datafile("_gru_ops.so"))
  File "C:\Users\Clémence\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\contrib\util\loader.py", line 55, in load_op_library
    ret = load_library.load_op_library(path)
  File "C:\Users\Clémence\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\python\framework\load_library.py", line 64, in load_op_library
    None, None, error_msg, error_code)
tensorflow.python.framework.errors_impl.NotFoundError: C:\Users\Clémence\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\contrib\rnn\python\ops\_gru_ops.dll not found

看起来这个文件丢失了:_gru_ops.dll

感谢您的回答和帮助

4 个答案:

答案 0 :(得分:0)

我遇到了同样的问题,但无法弄清楚如何正确解决问题。虽然Anaconda环境几乎预装了所有需要的软件包并且可以解决您的问题,但我建议您使用以下软件:

  • https://www.continuum.io/downloads
  • 安装Anaconda
  • 以管理员身份启动Anacondas提示并检查:pip install keraspip install tensorflow是否已安装所需的软件包
  • 现在在IDE中使用新的Python解释器或进行编译(例如在PyCharm中转到设置 - &gt;项目解释器并选择你的路径)

答案 1 :(得分:0)

我遇到了同样的问题,似乎tensorflow没有处理带有重音符号的路径(https://github.com/tensorflow/tensorflow/issues/9481)。

在我的tensorflow路径中有一个“é”(就像你一样)并将我的安装移到另一个文件夹修复了我的问题。

答案 2 :(得分:0)

只需将XX.dll重命名为XX.dll.bak.Maybe系统会询问trustedinstaller

答案 3 :(得分:0)

  • 卸载tensorflow使用pip uninstall tensorflow
  • 以管理员身份运行cmd,然后使用pip install tensorflow