Tensorflow 2.13.1,找不到tensorflow-text 2.13.0的匹配分布

问题描述 投票:0回答:3

我正在尝试使用 Python 3.11 安装最新的 Tensorflow 模型 2.13.1 (pip install tf-models-official==2.13.1)。自上周以来,Cython 和 PyYAML 在 Tensorflow 模型 2.13.0 中似乎无法很好地协同工作,因此无法安装。

但是 2.13.1 给我一个错误,找不到相应的tensorflow-text版本2.13.0。 我收到的错误如下:

(tensorflow-env) username@DESKTOP:~/projects/tensorflow/models-master/research$ pip install tf-models-official==2.13.1
INFO: pip is looking at multiple versions of tf-models-official to determine which version is compatible with other requirements. This could take a while.
ERROR: Ignored the following versions that require a different python version: 1.21.2 Requires-Python >=3.7,<3.11; 1.21.3 Requires-Python >=3.7,<3.11; 1.21.4 Requires-Python >=3.7,<3.11; 1.21.5 Requires-Python >=3.7,<3.11; 1.21.6 Requires-Python >=3.7,<3.11; 1.6.2 Requires-Python >=3.7,<3.10; 1.6.3 Requires-Python >=3.7,<3.10; 1.7.0 Requires-Python >=3.7,<3.10; 1.7.1 Requires-Python >=3.7,<3.10; 1.7.2 Requires-Python >=3.7,<3.11; 1.7.3 Requires-Python >=3.7,<3.11; 1.8.0 Requires-Python >=3.8,<3.11; 1.8.0rc1 Requires-Python >=3.8,<3.11; 1.8.0rc2 Requires-Python >=3.8,<3.11; 1.8.0rc3 Requires-Python >=3.8,<3.11; 1.8.0rc4 Requires-Python >=3.8,<3.11; 1.8.1 Requires-Python >=3.8,<3.11
ERROR: Could not find a version that satisfies the requirement tensorflow-text~=2.13.0 (from tf-models-official) (from versions: 2.12.0rc0, 2.12.0, 2.12.1, 2.13.0rc0)
ERROR: No matching distribution found for tensorflow-text~=2.13.0

但是 pypi.org 上的发布历史显示 2.13.0 版本的 tensorflow-text 已经发布:https://pypi.org/project/tensorflow-text/2.13.0/#history

我做错了什么?

python python-3.x tensorflow pip tensorflow2.0
3个回答
3
投票

我通过安装解决了这个问题

Python 3.10
Tensorflow 2.13.0
tensorflow-text 2.13.0
tensorflow-models-official 2.13.1

一切都适用于这些版本,但我没有找到使其适用于 Python 3.11 atm 的方法。

这个问题在这里得到了最好的描述(https://github.com/yaml/pyyaml/issues/724)并且与 Cython 和 PyYAML 5.4 依赖问题有关。


2
投票

在尝试安装

mediapipe-model-maker
pip 包时,我遇到了完全相同的问题。

事实证明,tensorflow-text 的维护者停止了为多个操作系统提供预构建的 python 轮子(现在仅支持 Linux 或基于 Intel 的 Mac)。 这就是为什么

pip install
找不到
tensorflow-text~=2.13.0
的匹配分布。

相反,您必须自己构建它,或者依赖官方构建合作者,他们慷慨地为我们构建和上传它们。 例如,对于基于 Arm 的 Mac,您可以从此 Github 存储库下载并手动安装 whl 文件。


0
投票

在 Windows 上遇到同样的错误。看起来

tensorflow-text
在 pypi 上不可用(自 2022 年起 Windows 不再有轮子)。

我还需要安装

tf-models-official
来进行图像实例分割。 既然
tensorflow-text
是一个用于文本相关处理操作(用于 NLP)的 TensorFlow 库,那么它真的需要吗? 我们可以手动修改
tf-models-official
包来删除
tensorflow-text
依赖吗?

© www.soinside.com 2019 - 2024. All rights reserved.