I receive the following error when running import tensorflow_probability as tfp :
AttributeError: module 'tensorflow._api.v1.compat' has no attribute 'v1'
I installed tfp and tfp-nightly via pip inside an existing virtualenv environment :
pip install tfp-nightly
Python 3.6.5 (v3.6.5:f59c0932b4, Mar 28 2018, 05:52:31)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow_probability as tfp
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/leejin/rl/lib/python3.6/site-packages/tensorflow_probability/__init__.py", line 78, in <module>
from tensorflow_probability.python import * # pylint: disable=wildcard-import
File "/Users/user-name/rl/lib/python3.6/site-packages/tensorflow_probability/python/__init__.py", line 22, in <module>
from tensorflow_probability.python import distributions
File "/Users/user-name/rl/lib/python3.6/site-packages/tensorflow_probability/python/distributions/__init__.py", line 24, in <module>
from tensorflow_probability.python.distributions.bernoulli import Bernoulli
File "/Users/user-name/rl/lib/python3.6/site-packages/tensorflow_probability/python/distributions/bernoulli.py", line 153, in <module>
@kullback_leibler.RegisterKL(Bernoulli, tf.compat.v1.distributions.Bernoulli)
AttributeError: module 'tensorflow._api.v1.compat' has no attribute 'v1'
>>>
tensorflow 1.12.0
tensorflow-probability 0.5.0
tfp-nightly 0.7.0.dev20190218
Any assistance is greatly appreciated!!
You only need one or the other of tensorflow-probability and tfp-nightly, not both. If you use nightly you also need tf-nightly instead of tensorflow.
@csuter Oh, definitely my bad ;P Thanks for your advice!
No worries!
have installed tensorflow==1.8.0, i have to run a file in order to star my training. but I am getting this error.
ModuleNotFoundError: No module named 'tensorflow.compat'
then i wrote this command "pip install tensorflow.compat" i got following error
ERROR: Could not find a version that satisfies the requirement tensorflow.compat (from versions: none)
ERROR: No matching distribution found for tensorflow.compat
That's a pretty ancient TF version. I'd suggest 1.15.0 with TFP 0.8.0, or
the nightly of each.
On Thu, Oct 24, 2019, 1:03 AM sehargul-123 notifications@github.com wrote:
have installed tensorflow==1.8.0, i have to run a file in order to star my
training. but I am getting this error.
ModuleNotFoundError: No module named 'tensorflow.compat'
then i wrote this command "pip install tensorflow.compat" i got following
error
ERROR: Could not find a version that satisfies the requirement
tensorflow.compat (from versions: none)
ERROR: No matching distribution found for tensorflow.compat—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/tensorflow/probability/issues/295?email_source=notifications&email_token=AFJFSI2B4SAAFA6CIGSCP2LQQEUBLA5CNFSM4GYDNHT2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOECDWVKY#issuecomment-545745579,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AFJFSI4PLWQMWHXNU75MIBDQQEUBLANCNFSM4GYDNHTQ
.
Most helpful comment
You only need one or the other of tensorflow-probability and tfp-nightly, not both. If you use nightly you also need tf-nightly instead of tensorflow.