无法安装tensorflow_federated

hmmo2u0o  于 2023-08-06  发布在  其他
关注(0)|答案(2)|浏览(110)

我正在使用Google Colab尝试使用TensorFlow进行联合学习。安装tensorflow_federated时遇到了一些问题。我知道tensorflow tff要求python版本是3.9或更高,但python当前版本是3.10.12,sys的版本也是一样的,那么我该如何解决这个问题呢?
产品编号:!pip install --quiet --upgrade tensorflow-federated
错误代码:

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
arviz 0.15.1 requires scipy>=1.8.0, but you have scipy 1.7.3 which is incompatible.
chex 0.1.7 requires jax>=0.4.6, but you have jax 0.3.15 which is incompatible.
orbax-checkpoint 0.2.6 requires jax>=0.4.9, but you have jax 0.3.15 which is incompatible.
pymc 5.1.2 requires cachetools>=4.2.1, but you have cachetools 3.1.1 which is incompatible.

字符串
我还尝试下载了TensorFlow0.20.0和0.55.0,但没有成功

qybjjes1

qybjjes11#

通过下面的步骤,我可以开始跑步了。请注意,未来的依赖关系很容易导致此解决方案中断。
1.将运行时更改为Google Colab中的GPU会话。
1.手动安装以下包依赖项

!pip install jax==0.4.10
!pip install cachetools==4.2.1
!pip install dp_accounting
!pip install tensorflow_privacy
!pip install tensorflow_compression
!pip install tensorflow_model_optimization
!pip install pyfarmhash
!pip install google-vizier

字符串
1.重新启动运行库。
1.安装tensorflow_federated,不带任何依赖项。
第一个月
1.测试以确保tensorflow_federated正常工作。

import tensorflow_federated as tff
import numpy as np

np.random.seed(0)
tff.federated_computation(lambda: 'Hello, World!')()

jdgnovmf

jdgnovmf2#

使用Python 3.10Google Colab中安装TF Federated时未发现问题/错误。请再次尝试在Colab中安装TF Federated,并检查问题是否仍然存在?

!pip install tensorflow-federated # (restart the kernel)

import tensorflow_federated as tfds
tfds.__version__

字符串
输出量:

'0.61.0'


请看下面的截图:(它正在安装最新的TF Federated版本0.61.0)
x1c 0d1x的数据

相关问题