简体   繁体   English

使用 RASA NLU 训练模型时的 Tensorflow 错误

[英]Tensorflow error while training model with RASA NLU

I am using RASA NLU.我正在使用 RASA NLU。 While training the bot I am getting the following exceptionL在训练机器人时,我收到以下异常

a. ImportError: No module named '_pywrap_tensorflow_internal'
b. Failed to load the native TensorFlow runtime.

and quite a bit of errors in stack trace as one can see at the end of the post.正如你在文章末尾看到的那样,堆栈跟踪中有相当多的错误。

Here is snippet of versions I am using for different modules with python 3.6.8 :这是我使用python 3.6.8用于不同模块的版本片段:

tensorboard                        1.8.0
rasa-core                          0.10.1
rasa-nlu                           0.13.0a2
Keras                              2.1.6

I ensured the training domain yaml is placed in right location and has no errors.我确保训练域yaml放置在正确的位置并且没有错误。

Stack Trace:堆栈跟踪:

\ML-Python\RASA\Rasa_basic_folder>python ./train_init.py
F:\Anaconda-32bit\lib\site-packages\h5py\__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
  from ._conv import register_converters as _register_converters
Using TensorFlow backend.
Traceback (most recent call last):
  File "F:\Anaconda-32bit\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 18, in swig_import_helper
    fp, pathname, description = imp.find_module('_pywrap_tensorflow_internal', [dirname(__file__)])
  File "F:\Anaconda-32bit\lib\imp.py", line 297, in find_module
    raise ImportError(_ERR_MSG.format(name), name=name)
ImportError: No module named '_pywrap_tensorflow_internal'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "F:\Anaconda-32bit\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "F:\Anaconda-32bit\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "F:\Anaconda-32bit\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 20, in swig_import_helper
    import _pywrap_tensorflow_internal
ModuleNotFoundError: No module named '_pywrap_tensorflow_internal'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "./train_init.py", line 19, in <module>
    agent = Agent('./restaurant_domain.yml', policies = [MemoizationPolicy(max_history = 4), KerasPolicy(featurizer)])
  File "c:\python27\scripts\rasa_core-master\rasa_core\policies\keras_policy.py", line 47, in __init__
    if KerasPolicy.is_using_tensorflow() and not graph:
  File "c:\python27\scripts\rasa_core-master\rasa_core\policies\keras_policy.py", line 64, in is_using_tensorflow
    from keras.backend import _BACKEND
  File "F:\Anaconda-32bit\lib\site-packages\keras\__init__.py", line 3, in <module>
    from . import utils
  File "F:\Anaconda-32bit\lib\site-packages\keras\utils\__init__.py", line 6, in <module>
    from . import conv_utils
  File "F:\Anaconda-32bit\lib\site-packages\keras\utils\conv_utils.py", line 9, in <module>
    from .. import backend as K
  File "F:\Anaconda-32bit\lib\site-packages\keras\backend\__init__.py", line 84, in <module>
    from .tensorflow_backend import *
  File "F:\Anaconda-32bit\lib\site-packages\keras\backend\tensorflow_backend.py", line 5, in <module>
    import tensorflow as tf
  File "F:\Anaconda-32bit\lib\site-packages\tensorflow\__init__.py", line 24, in <module>
    from tensorflow.python import pywrap_tensorflow  # pylint: disable=unused-import
  File "F:\Anaconda-32bit\lib\site-packages\tensorflow\python\__init__.py", line 49, in <module>
    from tensorflow.python import pywrap_tensorflow
  File "F:\Anaconda-32bit\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 74, in <module>
    raise ImportError(msg)
ImportError: Traceback (most recent call last):
  File "F:\Anaconda-32bit\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 18, in swig_import_helper
    fp, pathname, description = imp.find_module('_pywrap_tensorflow_internal', [dirname(__file__)])
  File "F:\Anaconda-32bit\lib\imp.py", line 297, in find_module
    raise ImportError(_ERR_MSG.format(name), name=name)
ImportError: No module named '_pywrap_tensorflow_internal'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "F:\Anaconda-32bit\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
  from tensorflow.python.pywrap_tensorflow_internal import *
  File "F:\Anaconda-32bit\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "F:\Anaconda-32bit\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 20, in swig_import_helper
    import _pywrap_tensorflow_internal
ModuleNotFoundError: No module named '_pywrap_tensorflow_internal'

Seems like tensorflow is not correctly installed.似乎tensorflow没有正确安装。 Please try re-installing rasa-core with pip install -U rasa-core or even update to the new rasa package, which combines rasa-nlu and rasa-core (the old rasa-core and rasa-nlu are packages are deprecated).请尝试使用pip install -U rasa-core重新安装 rasa-core 或者甚至更新到新的rasa包,它结合了 rasa-nlu 和 rasa-core(旧的rasa-corerasa-nlu包已被弃用)。 You can do so by doing pip install rasa .您可以通过执行pip install rasa

为您解决这些 tensorflow 依赖项 - 请参见下文。

pip install rasa[convert]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM