有人可以向我解释如何逐步安装Tensorflow for Python 3.7.0! (我正在使用ipython)! 我的系统是Windows 10 64位系统。 即使到目前为止我已经找到所有的解释,我也不知道该怎么办。 那么有人可以指出我要单击以安装张量流的确切链接吗? Tnx
ImportError Traceback (most recent call last)
~\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py in <module>()
57
---> 58 from tensorflow.python.pywrap_tensorflow_internal import *
59 from tensorflow.python.pywrap_tensorflow_internal import __version__
~\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py in <module>()
27 return _mod
---> 28 _pywrap_tensorflow_internal = swig_import_helper()
29 del swig_import_helper
~\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py in swig_import_helper()
23 try:
---> 24 _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
25 finally:
~\Anaconda3\lib\imp.py in load_module(name, file, filename, details)
242 else:
--> 243 return load_dynamic(name, filename, file)
244 elif type_ == PKG_DIRECTORY:
~\Anaconda3\lib\imp.py in load_dynamic(name, path, file)
342 name=name, loader=loader, origin=path)
--> 343 return _load(spec)
344
ImportError: DLL load failed: Een initialisatieroutine van de dynamic link library (DLL-bestand) is mislukt.
During handling of the above exception, another exception occurred:
ImportError Traceback (most recent call last)
<ipython-input-2-fae406f752e9> in <module>()
6 from PIL import Image
7 from scipy import ndimage
----> 8 import tensorflow as tf
9 from tensorflow.python.framework import ops
10 from cnn_utils import *
~\Anaconda3\lib\site-packages\tensorflow\__init__.py in <module>()
20
21 # pylint: disable=g-bad-import-order
---> 22 from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import
23
24 try:
~\Anaconda3\lib\site-packages\tensorflow\python\__init__.py in <module>()
47 import numpy as np
48
---> 49 from tensorflow.python import pywrap_tensorflow
50
51 # Protocol buffers
~\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py in <module>()
72 for some common reasons and solutions. Include the entire stack trace
73 above this error message when asking for help.""" % traceback.format_exc()
---> 74 raise ImportError(msg)
75
76 # pylint: enable=wildcard-import,g-import-not-at-top,unused-import,line-too-long
ImportError: Traceback (most recent call last):
File "C:\Users\gstevens\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Users\gstevens\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\Users\gstevens\Anaconda3\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\gstevens\Anaconda3\lib\imp.py", line 243, in load_module
return load_dynamic(name, filename, file)
File "C:\Users\gstevens\Anaconda3\lib\imp.py", line 343, in load_dynamic
return _load(spec)
ImportError: DLL load failed: Een initialisatieroutine van de dynamic link library (DLL-bestand) is mislukt.
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.
答案 0 :(得分:1)
总结official tensorflow installation guide中针对您的情况的安装步骤。
由于您已经在计算机上安装了Python 3.6和Conda(这很好!),我们可以继续确认其他内容。
安装 Microsoft Visual C ++ 2015可再发行组件更新3 。这是 Visual Studio 2015 附带的,但可以单独安装:
打开命令提示符。由于您已经创建了名称为tensorflow
的环境,因此只需要:
conda create -n venv pip python=3.6
。将venv
替换为您选择的环境名称。source activate tensorflow
。此行中的tensorflow
是您运行conda create -n tensorflow python=3.6
时命名的Conda环境的名称。除非您已按照步骤1进行操作并创建了新环境,否则请用在步骤1中使用的名称替换tensorflow
。 pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-1.11.0-cp36-cp36m-win_amd64.whl
如果以后再次安装,请根据URL列表更新上述命令中的URL。上面的命令最终将过时。
重新启动命令提示符,然后再次激活conda环境,然后运行python -c "import tensorflow as tf; print(tf.__version__)"
,它将打印出您已安装的Tensorflow版本,在本例中为1.11.0。如果是这样,则说明您已经在您的Conda虚拟环境中成功安装了Tensorflow。恭喜!
如果它不起作用,请在此处评论,以便我修改答案以进一步为您提供帮助。
答案 1 :(得分:0)
Tensorflow尚不支持Python 3.7(https://github.com/tensorflow/tensorflow/issues/17022)。
使用Python 3.6。