在Windows上,TensorFlow在执行import tensorflow语句后报告以下错误中的一个或两个:
No module named "_pywrap_tensorflow"DLL load failed.我刚刚在ubuntu上重新安装了最新的tensorflow:
$ sudo pip install --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.7.1-cp27-none-linux_x86_64.whl
[sudo] password for ubuntu:
The directory '/home/ubuntu/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/ubuntu/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If …Run Code Online (Sandbox Code Playgroud) 我有一台台式电脑和一个笔记本,当我尝试使用pip install tensorflow 在笔记本上安装 tensorflow 时它工作正常,然后我在台式电脑上尝试了同样的方法,当我尝试运行最简单的代码时:
import tensorflow as tf
from tensorflow.keras import Sequential
print("done")
Run Code Online (Sandbox Code Playgroud)
我收到了这个非常复杂的错误消息:
Traceback (most recent call last):
File "C:\Users\Mechatrnk\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow_core\python\pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Users\Mechatrnk\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\Users\Mechatrnk\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
File "C:\Users\Mechatrnk\AppData\Local\Programs\Python\Python37\lib\imp.py", line 242,
in load_module
return load_dynamic(name, filename, file)
File "C:\Users\Mechatrnk\AppData\Local\Programs\Python\Python37\lib\imp.py", line 342,
in load_dynamic
return _load(spec)
ImportError: DLL load failed: Uvedený modul nebyl …Run Code Online (Sandbox Code Playgroud)