tensorboard ImportError: DLL load failed: 找不到指定的模块。

£神魔★判官ぃ 2022-02-16 11:55 476阅读 0赞

问题:tensorboard —logdir=E:\logs 报错

错误如下:

  1. Traceback (most recent call last):
  2. File "d:\anoconda5.2.0\envs\tensorflow\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 18, in swig_import_helper
  3. return importlib.import_module(mname)
  4. File "d:\anoconda5.2.0\envs\tensorflow\lib\importlib\__init__.py", line 126, in import_module
  5. return _bootstrap._gcd_import(name[level:], package, level)
  6. File "<frozen importlib._bootstrap>", line 978, in _gcd_import
  7. File "<frozen importlib._bootstrap>", line 961, in _find_and_load
  8. File "<frozen importlib._bootstrap>", line 950, in _find_and_load_unlocked
  9. File "<frozen importlib._bootstrap>", line 648, in _load_unlocked
  10. File "<frozen importlib._bootstrap>", line 560, in module_from_spec
  11. File "<frozen importlib._bootstrap_external>", line 922, in create_module
  12. File "<frozen importlib._bootstrap>", line 205, in _call_with_frames_removed
  13. ImportError: DLL load failed: 找不到指定的模块。
  14. During handling of the above exception, another exception occurred:
  15. Traceback (most recent call last):
  16. File "d:\anoconda5.2.0\envs\tensorflow\lib\site-packages\tensorflow\python\__init__.py", line 54, in <module>
  17. from tensorflow.python import pywrap_tensorflow
  18. File "d:\anoconda5.2.0\envs\tensorflow\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 21, in <module>
  19. _pywrap_tensorflow = swig_import_helper()
  20. File "d:\anoconda5.2.0\envs\tensorflow\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 20, in swig_import_helper
  21. return importlib.import_module('_pywrap_tensorflow')
  22. File "d:\anoconda5.2.0\envs\tensorflow\lib\importlib\__init__.py", line 126, in import_module
  23. return _bootstrap._gcd_import(name[level:], package, level)
  24. ModuleNotFoundError: No module named '_pywrap_tensorflow'
  25. During handling of the above exception, another exception occurred:
  26. Traceback (most recent call last):
  27. File "d:\anoconda5.2.0\envs\tensorflow\lib\runpy.py", line 193, in _run_module_as_main
  28. "__main__", mod_spec)
  29. File "d:\anoconda5.2.0\envs\tensorflow\lib\runpy.py", line 85, in _run_code
  30. exec(code, run_globals)
  31. File "D:\anoconda5.2.0\envs\tensorflow\Scripts\tensorboard.exe\__main__.py", line 5, in <module>
  32. File "d:\anoconda5.2.0\envs\tensorflow\lib\site-packages\tensorflow\__init__.py", line 24, in <module>
  33. from tensorflow.python import *
  34. File "d:\anoconda5.2.0\envs\tensorflow\lib\site-packages\tensorflow\python\__init__.py", line 60, in <module>
  35. raise ImportError(msg)
  36. ImportError: Traceback (most recent call last):
  37. File "d:\anoconda5.2.0\envs\tensorflow\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 18, in swig_import_helper
  38. return importlib.import_module(mname)
  39. File "d:\anoconda5.2.0\envs\tensorflow\lib\importlib\__init__.py", line 126, in import_module
  40. return _bootstrap._gcd_import(name[level:], package, level)
  41. File "<frozen importlib._bootstrap>", line 978, in _gcd_import
  42. File "<frozen importlib._bootstrap>", line 961, in _find_and_load
  43. File "<frozen importlib._bootstrap>", line 950, in _find_and_load_unlocked
  44. File "<frozen importlib._bootstrap>", line 648, in _load_unlocked
  45. File "<frozen importlib._bootstrap>", line 560, in module_from_spec
  46. File "<frozen importlib._bootstrap_external>", line 922, in create_module
  47. File "<frozen importlib._bootstrap>", line 205, in _call_with_frames_removed
  48. ImportError: DLL load failed: 找不到指定的模块。
  49. During handling of the above exception, another exception occurred:
  50. Traceback (most recent call last):
  51. File "d:\anoconda5.2.0\envs\tensorflow\lib\site-packages\tensorflow\python\__init__.py", line 54, in <module>
  52. from tensorflow.python import pywrap_tensorflow
  53. File "d:\anoconda5.2.0\envs\tensorflow\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 21, in <module>
  54. _pywrap_tensorflow = swig_import_helper()
  55. File "d:\anoconda5.2.0\envs\tensorflow\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 20, in swig_import_helper
  56. return importlib.import_module('_pywrap_tensorflow')
  57. File "d:\anoconda5.2.0\envs\tensorflow\lib\importlib\__init__.py", line 126, in import_module
  58. return _bootstrap._gcd_import(name[level:], package, level)
  59. ModuleNotFoundError: No module named '_pywrap_tensorflow'
  60. Error importing tensorflow. Unless you are using bazel,
  61. you should not try to import tensorflow from its source directory;
  62. please exit the tensorflow source tree, and relaunch your python interpreter
  63. from there.

解决方法:

1.启动Anaconda Prompt

2.activate 自己的环境名

3.安装tensorflow

  1. conda install tensorflow

解决了上述问题,验证一下:

(tensorflow) C:\Users\Administrator>tensorboard —logdir=E:\code\DCGANceleba\celeba_train\logs

20190422132458284.png

打开浏览器,把网址 http://DESKTOP-CP7SIIN:6006 复制进去watermark_type_ZmFuZ3poZW5naGVpdGk_shadow_10_text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzI3ODU1MjE5_size_16_color_FFFFFF_t_70

watermark_type_ZmFuZ3poZW5naGVpdGk_shadow_10_text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzI3ODU1MjE5_size_16_color_FFFFFF_t_70 1

可能解决了此问题还依赖于别的因素:

1.安装 vc的一个dll文件。下载地址:

https://download.microsoft.com/download/6/D/F/6DF3FF94-F7F9-4F0B-838C-A328D1A7D0EE/vc_redist.x64.exe

2.D:\anoconda5.2.0\Library\bin加入到环境变量path

3.重装numpy pip install numpy

发表评论

表情:
评论列表 (有 0 条评论,476人围观)

还没有评论,来说两句吧...

相关阅读