tensorflow / tensorflow/probability

Hidden requirement of tensorflow version should use extras_require

Open
#1,468 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Jupyter Notebook
Stars
4.4k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

I'm noticing issues very time we update the requirement of tensoflow for this check:

https://github.com/tensorflow/probability/blob/40b18076b53d7c6e22e1fa5f95d805be0cfa0cc1/tensorflow_probability/python/__init__.py#L52-L64

It would be nice if we could add an option to extras_require so that it was more like:

extras_require={  # e.g. `pip install tfp-nightly[jax]` 
     'jax': ['jax', 'jaxlib'], 
     'tfds': [TFDS_PACKAGE], 
     'tf': ['tensorflow>=2.8'],          # <--- Add a tf option here 
     'tf_gpu': ['tensorflow-gpu>=2.8'],  # <--- Add a tf_gpu option here 
 } 

This way if somebody is using both tensorflow and tensorflow_privacy, they can put:

# requirements.txt
tensorflow >= 2.6
tensorflow_privacy[tf]

and there will be no package conflicts after install.

Relevant: https://github.com/tensorflow/tensorflow/issues/7166

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the dependency-version check in tensorflow_probability/python/init.py and inspect the package configuration that defines extras_require. Compare the requested tf, tf_gpu, jax, and tfds extras with the existing dependency setup; done means the TensorFlow extras express the supported requirements without the reported package conflict.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, tensorflow
Domain
build-system, machine-learning
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.