I import TensorFlow probability regularly and these are my two layers:
tfp.layers.DenseFlipout(512, activation=tf.nn.relu), tfp.layers.DenseFlipout(10),
However, I keep receiving this message when I run this:
File "dark.py", line 10, in import tensorflow_probability as tfp File "C:\Python\Python37\lib\site-packages\tensorflow_probability\__init__.py", line 75, in <module> from tensorflow_probability.python import * # pylint: disable=wildcard-import File "C:\Python\Python37\lib\site-packages\tensorflow_probability\python\__init__.py", line 21, in <module> from tensorflow_probability.python import bijectors File "C:\Python\Python37\lib\site-packages\tensorflow_probability\python\bijectors\__init__.py", line 23, in <module> from tensorflow_probability.python.bijectors.absolute_value import AbsoluteValue File "C:\Python\Python37\lib\site-packages\tensorflow_probability\python\bijectors\absolute_value.py", line 23, in <module> from tensorflow_probability.python.bijectors import bijector File "C:\Python\Python37\lib\site-packages\tensorflow_probability\python\bijectors\bijector.py", line 213, in <module> class Bijector(tf.Module): File "C:\Python\Python37\lib\site-packages\tensorflow_probability\python\bijectors\bijector.py", line 570, in Bijector _TF_MODULE_IGNORED_PROPERTIES = tf.Module._TF_MODULE_IGNORED_PROPERTIES.union( AttributeError: type object 'Module' has no attribute '_TF_MODULE_IGNORED_PROPERTIES'
import tensorflow_probability as tfp File "C:\Python\Python37\lib\site-packages\tensorflow_probability\__init__.py", line 75, in <module> from tensorflow_probability.python import * # pylint: disable=wildcard-import File "C:\Python\Python37\lib\site-packages\tensorflow_probability\python\__init__.py", line 21, in <module> from tensorflow_probability.python import bijectors File "C:\Python\Python37\lib\site-packages\tensorflow_probability\python\bijectors\__init__.py", line 23, in <module> from tensorflow_probability.python.bijectors.absolute_value import AbsoluteValue File "C:\Python\Python37\lib\site-packages\tensorflow_probability\python\bijectors\absolute_value.py", line 23, in <module> from tensorflow_probability.python.bijectors import bijector File "C:\Python\Python37\lib\site-packages\tensorflow_probability\python\bijectors\bijector.py", line 213, in <module> class Bijector(tf.Module): File "C:\Python\Python37\lib\site-packages\tensorflow_probability\python\bijectors\bijector.py", line 570, in Bijector _TF_MODULE_IGNORED_PROPERTIES = tf.Module._TF_MODULE_IGNORED_PROPERTIES.union( AttributeError: type object 'Module' has no attribute '_TF_MODULE_IGNORED_PROPERTIES'
Is there any way to solve this problem? I have searhed on the internet, but I didn't find anything.
Never mind (this is my other account), if you have the same problem then type
pip list
and check if you have tf.nightly, if you do then you need to type in this command
pip install tf.nightly-2.0-preview
It should work.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.