我想在Windows 10中使用Tensorflow(仅支持CPU)。我尝试了以下命令来使用pip安装,但是没有工作。 任何想法如何解决这个问题?
C:/Python35/Scripts/pip install --upgrade tensorflow
在Comman提示符下运行这个错误:
Collecting tensorflow Could not find a version that satisfies the requirement tensorflow (from versions: ) No matching distribution found for tensorflow
我也尝试使用pip3或URL安装:
C:\>C:/Python35/Scripts/pip install --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-1.0.0-cp35-cp35m-win_amd64.whl tensorflow-1.0.0-cp35-cp35m-win_amd64.whl is not a supported wheel on this platform.
但他们都没有工作。
重新安装Python35并使用https://pypi.python.org/pypi/tensorflow中的软件包
使用命令:
pip install "tensorflow-1.1.0rc2-cp35-cp35m-win_amd64.whl"
我能够正确地在Windows上运行tensorflow。 运行示例Tensorflow代码时,您可能会收到几个警告,例如:
2017-04-19 16:35:22.533979: W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE instructions, but these are available on your machine and could speed up CPU computations. 2017-04-19 16:35:22.534756: W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE2 instructions, but these are available on your machine and could speed up CPU computations. 2017-04-19 16:35:22.535027: W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE3 instructions, but these are available on your machine and could speed up CPU computations. 2017-04-19 16:35:22.535245: W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations. 2017-04-19 16:35:22.535462: W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations. 2017-04-19 16:35:22.535680: W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations. 2017-04-19 16:35:22.536664: W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX2 instructions, but these are available on your machine and could speed up CPU computations. 2017-04-19 16:35:22.536925: W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use FMA instructions, but these are available on your machine and could speed up CPU computations. b'Hello, TensorFlow!'
要解决这个问题,你可以使用下面的代码来消除TF的警告:
import os os.environ['TF_CPP_MIN_LOG_LEVEL']='2'
anaconda默认基于python 3.6,不支持tensorflow。 请按照以下链接中的指南进行操作: http : //www.stefangordon.com/install-tensorflow-in-anaconda-on-windows/
有一天,当我的pip
版本过时,我有这个确切的问题。 当你在控制台输入pip --version
时,你有什么版本?
我建议运行pip install --upgrade pip
将其更新到最新版本,然后重试。
点的版本应该> 9.0尝试升级点:
python -m pip install -U pip
Tensorflow的最新库不能在win64上使用最新的python,你需要降级到Python 3.5.x
测试win7企业版(64位,英特尔i5):
devlab@Ubuntu19 ~/Downloads $ python --version Python 3.5.3 devlab@Ubuntu19 ~/Downloads $ pip install tensorflow-1.1.0-cp35-cp35m-win_amd64.whl Processing c:\users\xt21966\downloads\tensorflow-1.1.0-cp35-cp35m- win_amd64.whl Collecting six>=1.10.0 (from tensorflow==1.1.0) Downloading six-1.10.0-py2.py3-none-any.whl Collecting protobuf>=3.2.0 (from tensorflow==1.1.0) Downloading protobuf-3.3.0.tar.gz (271kB) Collecting wheel>=0.26 (from tensorflow==1.1.0) Downloading wheel-0.29.0-py2.py3-none-any.whl (66kB) Collecting werkzeug>=0.11.10 (from tensorflow==1.1.0) Downloading Werkzeug-0.12.2-py2.py3-none-any.whl (312kB) Collecting numpy>=1.11.0 (from tensorflow==1.1.0) Downloading numpy-1.12.1-cp35-none-win_amd64.whl (7.7MB) Requirement already satisfied: setuptools in c:\users\xt21966\appdata\local\programs\python\python35\lib\site-packages (from protobuf>=3.2.0->tensorflow==1.1.0) Installing collected packages: six, protobuf, wheel, werkzeug, numpy, tensorflow Running setup.py install for protobuf: started Running setup.py install for protobuf: finished with status 'done' Successfully installed numpy-1.12.1 protobuf-3.3.0 six-1.10.0 tensorflow-1.1.0 werkzeug-0.12.2 wheel-0.29.0