Issue
When I try to import tensorflow_probability
, I get this error:
Traceback (most recent call last):
File "PATH", line 1, in <module>
import tensorflow_probability
File "PATH", line 75, in <module>
from tensorflow_probability.python import * # pylint: disable=wildcard-import
File "PATH", line 24, in <module>
from tensorflow_probability.python import edward2
File "PATH", line 32, in <module>
from tensorflow_probability.python.experimental.edward2.generated_random_variables import *
File "PATH", line 34, in <module>
from tensorflow_probability.python.experimental import auto_batching
File "PATH", line 24, in <module>
from tensorflow_probability.python.experimental.auto_batching import frontend
File "PATH", line 46, in <module>
from tensorflow.python.autograph.pyct import compiler
ImportError: cannot import name 'compiler' from 'tensorflow.python.autograph.pyct' (PATH)
I don't know why Python can't import this module because when I type pip list
in cmd, it tells me that I have tensorflow-probability 0.8.0rc0
installed. Any help would be greatly appreciated.
Solution
I have tried to import in Google colab
and Ubuntu 18
version. In colab
it worked directly, in ubuntu I faced issues.
Upgrading to the latest pip and TensorFlow version resolved my issue.
Colab:
import tensorflow_probability as tfp
Ubuntu 18:
Upgrade pip
pip install --upgrade pip
install the latest version of TensorFlow
pip install tensorflow
install tensorflow_probability
pip install --upgrade tensorflow-probability
tensorflow-probability version 0.11.1
Answered By - Tfer3
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.