Skip to content

Pin tensorflow_probability to work with TF 2.4.1 #1057

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ RUN pip install seaborn python-dateutil dask python-igraph && \
RUN pip install tensorflow==${TENSORFLOW_VERSION} && \
pip install tensorflow-gcs-config==2.4.0 && \
pip install tensorflow-addons==0.12.1 && \
pip install tensorflow_probability==0.12.2 && \
/tmp/clean-layer.sh

RUN apt-get install -y libfreetype6-dev && \
Expand Down
12 changes: 12 additions & 0 deletions tests/test_tensorflow_probability.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import unittest

# b/194837139 importing tensorflow before tfp was trigerring an error. Adding this import to prevent regression.
import tensorflow
import tensorflow_probability as tfp
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In our current image, I am able to import tensorflow_probability directly, it only fails if I first import tensorflow.



class TestTensorFlowProbability(unittest.TestCase):
def test_distribution(self):
tfd = tfp.distributions
dist = tfd.Bernoulli(logits=[-1, 1, 1])
self.assertEqual('Bernoulli', dist.name)