Fix TFRS v0.4.0 dependency on TF
See original GitHub issueNoticing that in requirements.txt, it says:
tensorflow >= 2.3.0
however in setup.py it says:
REQUIRED_PACKAGES = [
"absl-py >= 0.1.6",
"tensorflow == 2.4.*",
]
The latter is on master however; on 0.4.0 it says:
REQUIRED_PACKAGES = [
"absl-py >= 0.1.6",
"tensorflow == 2.4",
]
It seems to me that the requirements and the required packages are somewhat at odds with each other. >= 2.3.0 vs. ==2.4.* seems not quite a full match and perhaps a source of user confusion.
Also, the 2.4.* is a recent thing; it’s not in the 0.4.0 release.
If you install TF 2.4.1 first then TFRS, the TFRS install may wipe out TF 2.4.1 and install TF 2.4.0 instead. Which may be a surprise if your code is using something like the MultiWorkerMirroredStrategy which is in TF 2.4.1 but not 2.4.0.
If you then install TFRS 0.4.0 first then TF 2.4.1 you get what looks like a non-fatal error from pip3:
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.
tensorflow-recommenders 0.4.0 requires tensorflow==2.4, but you have tensorflow 2.4.1 which is incompatible.
“Non-fatal” because TF 2.4.1 is installed anyway; so this seems more of a warning than a true error.
I’m not sure what, if anything could or should be changed. Thought I’d jot this down as more of an item for folks to comment on.
Issue Analytics
- State:
- Created 2 years ago
- Comments:8

Top Related StackOverflow Question
Thanks for reporting this issue - I’ll be cutting a release next week and this will change to TF 2.4., then eventually to TF 2.5. once we update ScaNN.
The original issue should now be fixed, and the requirements should be aligned.