为什么TensorFlow WHL文件不包含所有必需的依赖项? [英] Why doesn't the TensorFlow WHL file contain all required dependencies?

查看:487
本文介绍了为什么TensorFlow WHL文件不包含所有必需的依赖项?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

系统:Windows 10 64位,python 3.6.5 64位.使用水蟒. CUDA 10.0,已安装cuddn.

system: windows 10 64 bit,python 3.6.5 64 bit. Use Anaconda. CUDA 10.0, cuddn installed.

美好的一天.出于安全原因,我们公司拒绝了Internet访问.我从TF tensorFlow官方网站下载了软件包:

good day. For security reasons, our company has denied access to the Internet. I downloaded from the official website TF tensorFlow whl package:

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

我尝试使用pip安装它:

I try to install it using 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根本看不到任何依赖项

When restarting, some other TensorFlow dependency will not be found, as I understand it, pip does not see any dependencies at all

我认为WHL软件包具有所有必要的依赖关系,但是在安装pip时,它将尝试从Internet下载某些内容.告诉我我在做什么错了吗?

I thought that the WHL package has all the necessary dependencies, but when installing pip it tries to download something from the Internet. Tell me what am I doing wrong?

pip检查tensorflow结果:

pip check tensorflow result:

(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.

推荐答案

我认为WHL软件包具有所有必要的依赖关系

I thought that the WHL package has all the necessary dependencies

不.车轮不包含所有依赖关系,也不应该包含所有依赖关系,否则每个车轮都会极度膨胀.如果必须在无法访问互联网的计算机上安装tensorflow-gpu(或其他轮子),请执行以下步骤:

No. Wheels don't contain all dependencies and they shouldn't, otherwise each wheel would be extremely bloated up. If you have to install tensorflow-gpu (or any other wheel) on a machine with no internet access, do the following steps:

  1. 在具有互联网访问权限的计算机上,运行:

  1. On a machine with internet access, run:

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

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

(you can run this command with passing as --dest the directory that contains the downloaded tensorflow_gpu-1.14.0-cp36-cp36m-win_amd64.whl so you don't have to download it again)

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

This will download tensorflow-gpu and all its dependency tree.

现在将目录(下载了所有文件)转移到计算机上 ,而无需访问Internet并运行:

Now transfer the directory (with all the files downloaded) to the machine without internet access and run:

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

--no-index会指示pip不要在线查找软件包,--find-links会指向可在其中找到要安装软件包的本地目录.

--no-index will instruct pip not to look up online for packages, --find-links will point to local directory where the packages can be found for installation.

这篇关于为什么TensorFlow WHL文件不包含所有必需的依赖项?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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