federated icon indicating copy to clipboard operation
federated copied to clipboard

Build/Installation issue: Conflicting Package Versions Requirements led to Missing Modules/Attributes - MacOS

Open yonatanweinberg opened this issue 3 years ago • 1 comments

System information MacBook Pro 2017 (intel chip), running Monterey 12.2.1. TensorFlow 2.8.0. Python version 3.8.8. Attempting to run it all via Google Colaboratory (so as far as I understand Bazel/Docker, or other forms of building a development environment are not necessary).

I am following the 'Federated Learning for Image Classification' Notebook covered in one of the federated workshops and decided to try implement it myself. I ran into my first issue when running the first two lines of code - installing tensorflow_federtated and tf-nightly. That issue came in the form of conflicting package version requirements i.e.

"ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behavior is the source of the following dependency conflicts. tf-nightly 2.9.0.dev20220228 requires tf-estimator-nightly~=2.9.0.dev, but you have tf-estimator-nightly 2.8.0.dev2021122109 which is incompatible."

Followed by:

"ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behavior is the source of the following dependency conflicts. tesnorflow 2.8.0 requires tf-estimator-nightly==2.8.0.dev2021122109 , but you have tf-estimator-nightly 2.9.0.dev2022022809 which is incompatible."

After trying to install various different versions of tf-nightly and tf-estimator-nightly, I finally came across a combination which compiled successfully. !pip install --quiet tf-estimator-nightly==2.8.0.dev2021122109 (the version required by tensorflow 2.8.0) !pip install --quiet tf-nightly==2.8.0.dev20211221

I then ran the next chunk of code, meant to print 'Hello World!', if installation and building went well, and ran into my next issue:

"AttributeError                            Traceback (most recent call last)
[<ipython-input-42-058105419b5a>](https://localhost:8080/#) in <module>()
     13 tf.compat.v1.enable_v2_behavior()
     14 
---> 15 tff.federated_computation(lambda: 'Hello, World!')()

AttributeError: module 'tensorflow_federated.python' has no attribute 'federated_computation'."

I suspect it has to do with the specific versions of tf-nightly & tf-estimator-nightly that I have installed, however no other combination of versions seems to 'agree' on the required version of the aforementioned, as well as other, packages.

Any help would be greatly appreciated :)

yonatanweinberg avatar Mar 01 '22 15:03 yonatanweinberg

Hi, the nightly version of tensorflow-federated is prone to these types of breakages, but we've updated the notebook to install the latest stable release instead. Can you try using that as well?

pip install --upgrade tensorflow-federated

hardik-vala avatar Mar 22 '22 23:03 hardik-vala