【问题标题】:Why doesn't the TensorFlow WHL file contain all required dependencies?为什么 TensorFlow WHL 文件不包含所有必需的依赖项?
【发布时间】:2019-07-17 20:13:12
【问题描述】:

系统:windows 10 64 位,python 3.6.5 64 位。使用蟒蛇。 CUDA 10.0,安装了 cuddn。

美好的一天。出于安全原因,我们公司拒绝访问互联网。我从官网下载的TF tensorFlow whl包:

https: //storage.googleapis.com/tensorflow/windows/gpu/tensorflow_gpu-1.14.0-cp36-cp36m-win_amd64.whl

我尝试使用 pip 安装它:

pip install --upgrade D:\tensorflow_gpu-1.14.0-cp36-cp36m-win_amd64.whl

我收到以下消息:

collecting keras-preprocessing>=1.0.5 (from tensorflow-gpu==1.14.0)
Retrying ....after connection broken by 'NewConnectionError'
......
could not find a version that satifies the requirement keras-preprocessing=>1.0.5.....
no matching distribution found for keras-preprocessing=>1.0.5 (from tensorflow-gpu==1.14.0)

重启时会找不到其他一些TensorFlow依赖,据我了解,pip根本看不到任何依赖

我认为 WHL 包具有所有必要的依赖项,但是在安装 pip 时,它会尝试从 Internet 下载一些东西。告诉我我做错了什么?

pip 检查张量流结果:

(base) C:\Windows\system32>pip check tensorflow

tensorflow 1.10.0 requires absl-py, which is not installed.
tensorflow 1.10.0 requires astor, which is not installed.
tensorflow 1.10.0 requires gast, which is not installed.
tensorflow 1.10.0 requires grpcio, which is not installed.
tensorflow 1.10.0 requires protobuf, which is not installed.
tensorflow 1.10.0 requires tensorboard, which is not installed.
tensorflow 1.10.0 requires termcolor, which is not installed.
tensorflow-gpu 1.14.0 requires absl-py, which is not installed.
tensorflow-gpu 1.14.0 requires astor, which is not installed.
tensorflow-gpu 1.14.0 requires gast, which is not installed.
tensorflow-gpu 1.14.0 requires google-pasta, which is not installed.
tensorflow-gpu 1.14.0 requires grpcio, which is not installed.
tensorflow-gpu 1.14.0 requires keras-applications, which is not installed.
tensorflow-gpu 1.14.0 requires keras-preprocessing, which is not installed.
tensorflow-gpu 1.14.0 requires protobuf, which is not installed.
tensorflow-gpu 1.14.0 requires tensorboard, which is not installed.
tensorflow-gpu 1.14.0 requires tensorflow-estimator, which is not installed.
tensorflow-gpu 1.14.0 requires termcolor, which is not installed.
distributed 1.21.8 requires msgpack, which is not installed.
tensorflow-gpu 1.14.0 has requirement numpy<2.0,>=1.14.5, but you have numpy 1.14.3.
tensorflow-gpu 1.14.0 has requirement wrapt>=1.11.1, but you have wrapt 1.10.11.

【问题讨论】:

    标签: python tensorflow installation


    【解决方案1】:

    我认为 WHL 包具有所有必要的依赖项

    没有。轮子不包含所有依赖项,它们也不应该包含,否则每个轮子都会非常臃肿。如果您必须在无法访问 Internet 的机器上安装 tensorflow-gpu(或任何其他轮子),请执行以下步骤:

    1. 在一台互联网访问的机器上,运行:

      \> pip download tensorflow-gpu --dest some\dir
      

      (您可以将包含已下载的tensorflow_gpu-1.14.0-cp36-cp36m-win_amd64.whl 的目录传递为--dest 来运行此命令,因此您不必再次下载它)

      这将下载tensorflow-gpu 及其所有依赖树。

    2. 现在将目录(已下载的所有文件)转移到机器没有互联网访问并运行:

      \> pip install tensorflow-gpu --no-index --find-links some\dir
      

      --no-index 将指示pip 不要在线查找包,--find-links 将指向可以找到包进行安装的本地目录。

    【讨论】:

      猜你喜欢
      • 2021-09-29
      • 2015-01-27
      • 1970-01-01
      • 1970-01-01
      • 2014-06-08
      • 1970-01-01
      • 2018-11-16
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多