Search code examples
tensorflowdeep-learninganacondatensorflow-probability

problem with importing tensorflow probability


I am using Anaconda and Ubuntu 18.04. I installed TensorFlow probability base on Anaconda's command:

 conda install -c conda-forge tensorflow-probability 

but when I wanted to import TensorFlow probability, I faced with below error:

ImportError: cannot import name 'compiler' from 'tensorflow.python.autograph.pyct' (/home/alireza/anaconda3/envs/tf-gpu/lib/python3.8/site-packages/tensorflow/python/autograph/pyct/init.py)

I check Anaconda by conda list tensorflow and TensorFlow probability version 0.8 was installed.

I appreciate your suggestion.


Solution

  • I think it's been a long time since the conda recipe for TFP was updated (TFP is now at 0.12), so you would need to ensure the version of TensorFlow you have is compatible. FWIW from the 0.8 release notes: "It is tested and stable against TensorFlow version 2.0.0 and 1.15.0rc1."