I am trying to run a code which is based on Tensorflow and Tensorflow-probability among other packages. When I have Tensorflow version of 2.10 and Tensorflow probability of 0.19.0 and try to run the code then I get this error -
"ImportError: This version of TensorFlow Probability requires TensorFlow version >= 2.11; Detected an installation of version 2.10.0. Please upgrade TensorFlow to proceed."
But when I upgrade the Tensorflow to 2.11 or the latest 2.14 then I get the following error message when I run the same code -
"AttributeError: module 'tensorflow' has no attribute 'random'"
I am running the code in jupyter within vscode. I made sure multiple times that I am in the right environment in vscode and the jupyter notebook but still I keep getting the error.
I checked the version when 2.10 was installed using the following code in Ipython interactive window
'''
import tensorflow as tf
print(tf.__version__)
'''
and it shows the version as 2.10 but when I do the same when 2.14 is installed I get the following error
"AttributeError: module 'tensorflow' has no attribute 'version'"
Not sure what is going wrong here, would appreciate some help.