\n 2020-05-14 00:02 采纳率: 0%
浏览 1550

Pycharm中可以运行,cmd运行时报错Failed to load the native TensorFlow runtime

在pycharm中设置了Python解释器,可以正常运行Python代码。
在cmd中使用相同的解释器去运行代码报错,下面是错误信息。

Traceback (most recent call last):
  File "C:\Users\xmei\.conda\envs\text_categorization\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "C:\Users\xmei\.conda\envs\text_categorization\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "C:\Users\xmei\.conda\envs\text_categorization\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper
    _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
  File "C:\Users\xmei\.conda\envs\text_categorization\lib\imp.py", line 243, in load_module
    return load_dynamic(name, filename, file)
  File "C:\Users\xmei\.conda\envs\text_categorization\lib\imp.py", line 343, in load_dynamic
    return _load(spec)
ImportError: DLL load failed: 找不到指定的模块。

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "G:\Text_categorization\project\system.py", line 11, in <module>
    from tcnn_model import *
  File "G:\Text_categorization\project\tcnn_model.py", line 5, in <module>
    import tensorflow as tf
  File "C:\Users\xmei\.conda\envs\text_categorization\lib\site-packages\tensorflow\__init__.py", line 24, in <module>
    from tensorflow.python import pywrap_tensorflow  # pylint: disable=unused-import
  File "C:\Users\xmei\.conda\envs\text_categorization\lib\site-packages\tensorflow\python\__init__.py", line 49, in <module>
    from tensorflow.python import pywrap_tensorflow
  File "C:\Users\xmei\.conda\envs\text_categorization\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 74, in <module>
    raise ImportError(msg)
ImportError: Traceback (most recent call last):
  File "C:\Users\xmei\.conda\envs\text_categorization\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "C:\Users\xmei\.conda\envs\text_categorization\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "C:\Users\xmei\.conda\envs\text_categorization\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper
    _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
  File "C:\Users\xmei\.conda\envs\text_categorization\lib\imp.py", line 243, in load_module
    return load_dynamic(name, filename, file)
  File "C:\Users\xmei\.conda\envs\text_categorization\lib\imp.py", line 343, in load_dynamic
    return _load(spec)
ImportError: DLL load failed: 找不到指定的模块。


Failed to load the native TensorFlow runtime.

See https://www.tensorflow.org/install/install_sources#common_installation_problems

for some common reasons and solutions.  Include the entire stack trace
above this error message when asking for help.
  • 写回答

1条回答 默认 最新

  • threenewbee 2020-09-25 00:37
    关注
    评论

报告相同问题?

悬赏问题

  • ¥15 k8s部署jupyterlab,jupyterlab保存不了文件
  • ¥15 ubuntu虚拟机打包apk错误
  • ¥199 rust编程架构设计的方案 有偿
  • ¥15 回答4f系统的像差计算
  • ¥15 java如何提取出pdf里的文字?
  • ¥100 求三轴之间相互配合画圆以及直线的算法
  • ¥100 c语言,请帮蒟蒻写一个题的范例作参考
  • ¥15 名为“Product”的列已属于此 DataTable
  • ¥15 安卓adb backup备份应用数据失败
  • ¥15 eclipse运行项目时遇到的问题