I am trying to install tensorflow federated using command: pip install tensorflow_federated The installation completes successfuly, but when I am import the package using command import tensorflow_federated as tff I get below error:
Traceback (most recent call last): File "", line 1, in File "/home/dgholam/.local/lib/python3.10/site-packages/tensorflow_federated/init.py", line 25, in from tensorflow_federated.python import * File "/home/dgholam/.local/lib/python3.10/site-packages/tensorflow_federated/python/init.py", line 25, in from tensorflow_federated.python.core import * File "/home/dgholam/.local/lib/python3.10/site-packages/tensorflow_federated/python/core/init.py", line 21, in from tensorflow_federated.python.core import utils File "/home/dgholam/.local/lib/python3.10/site-packages/tensorflow_federated/python/core/utils/init.py", line 26, in from tensorflow_federated.python.core.utils.computation_utils import IterativeProcess File "/home/dgholam/.local/lib/python3.10/site-packages/tensorflow_federated/python/core/utils/computation_utils.py", line 21, in from tensorflow_federated.python.core import api as tff File "/home/dgholam/.local/lib/python3.10/site-packages/tensorflow_federated/python/core/api/init.py", line 22, in from tensorflow_federated.python.core.api.computation_types import FederatedType File "/home/dgholam/.local/lib/python3.10/site-packages/tensorflow_federated/python/core/api/computation_types.py", line 26, in from tensorflow_federated.python.common_libs import anonymous_tuple File "/home/dgholam/.local/lib/python3.10/site-packages/tensorflow_federated/python/common_libs/anonymous_tuple.py", line 28, in nest = tf.contrib.framework.nest AttributeError: module 'tensorflow' has no attribute 'contrib'
I will appreciate to you, if you can help me with this issue. Python: 3.10.2 tensorflow-federated 0.1.0 tensorflow 2.11.0
I tried to install it with python 3.9.2 and 3.9.7 but I got another errors during installation. It seems tensorflow-federated needs tensorflow 2 and in tensorflow 2 there no contrib anymore. (contrib belongs to tensforlow 1.x.x)