在 Windows 上升级 tensorflow [英] upgrade tensorflow on windows

查看:30
本文介绍了在 Windows 上升级 tensorflow的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在我的 Windows 机器上升级 tensoflow 库?Tensorflow 目前已安装并运行良好.我正在使用 anaconda 发行版.

How do I upgrade the tensoflow library on my windows machine? Tensorflow is installed currently and runs fine. I am using anaconda distribution.

import tensorflow as tf

tf.VERSION
Out[37]: '1.2.1'

我的python版本低于

My python version is below

>python -V
Python 3.5.3 :: Anaconda custom (64-bit)

---------------更新 1 ------------------------------------------

---------------update 1 ------------------------------------------

尝试第一个答案并得到以下消息

>pip install tensorflow --upgrade
Collecting tensorflow
  Downloading tensorflow-1.3.0-cp35-cp35m-win_amd64.whl (25.5MB)
    100% |################################| 25.5MB 47kB/s
Collecting protobuf>=3.3.0 (from tensorflow)
  Downloading protobuf-3.4.0-py2.py3-none-any.whl (375kB)
    100% |################################| 378kB 1.4MB/s
Requirement already up-to-date: numpy>=1.11.0 in c:\users\johndoe\appdata\local\conda\conda\envs\tensorflowspyder\lib\site-packages (from tensorflow)
Collecting tensorflow-tensorboard<0.2.0,>=0.1.0 (from tensorflow)
  Downloading tensorflow_tensorboard-0.1.8-py3-none-any.whl (1.6MB)
    100% |################################| 1.6MB 591kB/s
Requirement already up-to-date: six>=1.10.0 in c:\users\johndoe\appdata\local\conda\conda\envs\tensorflowspyder\lib\site-packages (from tensorflow)
Collecting wheel>=0.26 (from tensorflow)
  Downloading wheel-0.30.0-py2.py3-none-any.whl (49kB)
    100% |################################| 51kB 1.2MB/s
Collecting setuptools (from protobuf>=3.3.0->tensorflow)
  Downloading setuptools-36.6.0-py2.py3-none-any.whl (481kB)
    100% |################################| 481kB 1.1MB/s
Requirement already up-to-date: werkzeug>=0.11.10 in c:\users\johndoe\appdata\local\conda\conda\envs\tensorflowspyder\lib\site-packages (from tensorflow-tensorboard<0.2.0,>=0.1.0->tensorflow)
Requirement already up-to-date: bleach==1.5.0 in c:\users\johndoe\appdata\local\conda\conda\envs\tensorflowspyder\lib\site-packages (from tensorflow-tensorboard<0.2.0,>=0.1.0->tensorflow)
Collecting markdown>=2.6.8 (from tensorflow-tensorboard<0.2.0,>=0.1.0->tensorflow)
  Downloading Markdown-2.6.9.tar.gz (271kB)
    100% |################################| 276kB 1.5MB/s
Requirement already up-to-date: html5lib==0.9999999 in c:\users\johndoe\appdata\local\conda\conda\envs\tensorflowspyder\lib\site-packages (from tensorflow-tensorboard<0.2.0,>=0.1.0->tensorflow)
Building wheels for collected packages: markdown
  Running setup.py bdist_wheel for markdown ... done
  Stored in directory: C:\Users\johndoe\AppData\Local\pip\Cache\wheels\bf\46\10\c93e17ae86ae3b3a919c7b39dad3b5ccf09aeb066419e5c1e5
Successfully built markdown
Installing collected packages: setuptools, protobuf, markdown, wheel, tensorflow-tensorboard, tensorflow
  Found existing installation: setuptools 36.2.0
    Uninstalling setuptools-36.2.0:
      Successfully uninstalled setuptools-36.2.0
  Rolling back uninstall of setuptools
Exception:
Traceback (most recent call last):
  File "C:\Users\johndoe\AppData\Local\conda\conda\envs\tensorflowspyder\lib\site-packages\pip\basecommand.py", line 215, in main
    status = self.run(options, args)
  File "C:\Users\johndoe\AppData\Local\conda\conda\envs\tensorflowspyder\lib\site-packages\pip\commands\install.py", line 342, in run
    prefix=options.prefix_path,
  File "C:\Users\johndoe\AppData\Local\conda\conda\envs\tensorflowspyder\lib\site-packages\pip\req\req_set.py", line 784, in install
    **kwargs
  File "C:\Users\johndoe\AppData\Local\conda\conda\envs\tensorflowspyder\lib\site-packages\pip\req\req_install.py", line 851, in install
    self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
  File "C:\Users\johndoe\AppData\Local\conda\conda\envs\tensorflowspyder\lib\site-packages\pip\req\req_install.py", line 1064, in move_wheel_files
    isolated=self.isolated,
  File "C:\Users\johndoe\AppData\Local\conda\conda\envs\tensorflowspyder\lib\site-packages\pip\wheel.py", line 247, in move_wheel_files
    prefix=prefix,
  File "C:\Users\johndoe\AppData\Local\conda\conda\envs\tensorflowspyder\lib\site-packages\pip\locations.py", line 140, in distutils_scheme
    d = Distribution(dist_args)
  File "C:\Users\johndoe\AppData\Local\conda\conda\envs\tensorflowspyder\lib\site-packages\setuptools\dist.py", line 365, in __init__
    self._finalize_requires()
  File "C:\Users\johndoe\AppData\Local\conda\conda\envs\tensorflowspyder\lib\site-packages\setuptools\dist.py", line 372, in _finalize_requires
    if not self.install_requires:
AttributeError: 'Distribution' object has no attribute 'install_requires'

我的版本还是一样

----------------update2----------------------------------我再次运行相同的命令并收到以下消息

----------------update2---------------------------------- I ran the same command again and got below message

>pip install tensorflow --upgrade
Collecting tensorflow
  Using cached tensorflow-1.3.0-cp35-cp35m-win_amd64.whl
Collecting tensorflow-tensorboard<0.2.0,>=0.1.0 (from tensorflow)
  Using cached tensorflow_tensorboard-0.1.8-py3-none-any.whl
Requirement already up-to-date: numpy>=1.11.0 in c:\users\johndoe\appdata\local\conda\conda\envs\tensorflowspyder\lib\site-packages (from tensorflow)
Collecting protobuf>=3.3.0 (from tensorflow)
  Using cached protobuf-3.4.0-py2.py3-none-any.whl
Requirement already up-to-date: six>=1.10.0 in c:\users\johndoe\appdata\local\conda\conda\envs\tensorflowspyder\lib\site-packages (from tensorflow)
Collecting wheel>=0.26 (from tensorflow)
  Using cached wheel-0.30.0-py2.py3-none-any.whl
Requirement already up-to-date: html5lib==0.9999999 in c:\users\johndoe\appdata\local\conda\conda\envs\tensorflowspyder\lib\site-packages (from tensorflow-tensorboard<0.2.0,>=0.1.0->tensorflow)
Collecting markdown>=2.6.8 (from tensorflow-tensorboard<0.2.0,>=0.1.0->tensorflow)
Requirement already up-to-date: bleach==1.5.0 in c:\users\johndoe\appdata\local\conda\conda\envs\tensorflowspyder\lib\site-packages (from tensorflow-tensorboard<0.2.0,>=0.1.0->tensorflow)
Requirement already up-to-date: werkzeug>=0.11.10 in c:\users\johndoe\appdata\local\conda\conda\envs\tensorflowspyder\lib\site-packages (from tensorflow-tensorboard<0.2.0,>=0.1.0->tensorflow)
Collecting setuptools (from protobuf>=3.3.0->tensorflow)
  Using cached setuptools-36.6.0-py2.py3-none-any.whl
Installing collected packages: setuptools, protobuf, markdown, wheel, tensorflow-tensorboard, tensorflow
  Found existing installation: setuptools 36.2.0
    Uninstalling setuptools-36.2.0:
      Successfully uninstalled setuptools-36.2.0
  Found existing installation: protobuf 3.3.0
    Uninstalling protobuf-3.3.0:
      Successfully uninstalled protobuf-3.3.0
  Found existing installation: Markdown 2.6.8
    Uninstalling Markdown-2.6.8:
      Successfully uninstalled Markdown-2.6.8
  Found existing installation: wheel 0.29.0
    Uninstalling wheel-0.29.0:
      Successfully uninstalled wheel-0.29.0
  Found existing installation: tensorflow 1.2.1
    Uninstalling tensorflow-1.2.1:
      Successfully uninstalled tensorflow-1.2.1
Successfully installed markdown-2.6.9 protobuf-3.4.0 setuptools-36.6.0 tensorflow-1.3.0 tensorflow-tensorboard-0.1.8 wheel-0.30.0

我查了一下,好像是tensorflow版本升级了

i checked and it seems that tensorflow version was upgraded

tf.VERSION
Out[2]: '1.3.0'

推荐答案

像普通包一样升级:

如果 tensorflow 安装在 conda 环境中

activate your-conda-environment

然后:

pip install pip --upgrade
pip install tensorflow --upgrade

这对我有用.

这篇关于在 Windows 上升级 tensorflow的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆