Problem definition:
In
probability/tensorflow_probability/python/optimizer/sgld.py
I receive the following error when running class StochasticGradientLangevinDynamics(tf.compat.v2.optimizers.Optimizer):
: module 'tensorflow._api.v1.compat' has no attribute 'v2'
Install process:
I installed tensorflow and tensorflow-probability, both through Conda cmds, in one of my existing Conda environments.
I also should specify that I have for each environment a specific IPython kernel, so that shouldn't be a problem with elsewhere existing TF installations.
Conda commands were:
conda install -n myenvname tensorflow
conda install -c conda-forge tensorflow-probability
Versions:
tensorflow 1.13.1
tensorflow-probability 0.5.0
Any help or assistance is much appreciated, thanks!
Hi there, we (TFP) don't maintain the conda build and I'm not sure how it works; I seem to recall it does not adhere to our prescribed installation procedure.
The most recent stable version of TFP is tensorflow-probability==0.6.0, which is tested and stable against tensorflow==1.13.1
Can you somehow force 0.6.0 to be installed instead of 0.5.0?
I got this error as well. I updated tensor flow-probability and tensor flow using pip. Now I am getting a new error "No module named tensorflow.compat.v2". I did use the prescribed installation procedure
Do you have a stack trace for the import error? Did you install with pip? Can you share your pip list?
Maybe you can use the code in Branch r0.5. The master is different from the Branch. I think there are some compatibility issues for the TF 1.13. TF 2.0 is suitable for TF-probability 0.6. @mkcliona
Thanks, @haolsun, but this is not quite right (maybe there was a typo?).
TFP 0.6 is compatible with TF 1.13 -- it will not work with TF 2.0 (alpha or nightly)
tfp-nightly will work with tf-nIghtly and tf-nightly-2.0-preview, and might work with TF 2.0 alpha, although we don't have continuous integration testing for this combination (it did work several weeks ago, but tfp-nightly has continued progressing while TF 2.0a hasn't been updated AFAIK).
Still getting the module 'TensorFlow._api.v1.compat' has no attribute 'v2' error. I have TensorFlow version 1.13.1 and TensorFlow probability 0.9.0. Kindly give the solution.
Can you upgrade your TF build? TFP 0.9 is compatible with TF 2.1
Brian Patton | Software Engineer | [email protected]
On Tue, Jan 28, 2020 at 12:31 AM GauravRaturi notifications@github.com
wrote:
Still getting the module 'TensorFlow._api.v1.compat' has no attribute 'v2'
error. I have TensorFlow version 1.13.1 and TensorFlow probability 0.9.0.
Kindly give the solution.—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/tensorflow/probability/issues/354?email_source=notifications&email_token=AFJFSIZUOI4MADWSLA7SDQ3Q767MHA5CNFSM4HED2R52YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEKCCYZQ#issuecomment-579087462,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AFJFSI5M3AKS4JGMSBMQBS3Q767MHANCNFSM4HED2R5Q
.
More info on TFP releases & compatibility is here
https://github.com/tensorflow/probability/releases
Brian Patton | Software Engineer | [email protected]
On Tue, Jan 28, 2020 at 10:50 AM Brian Patton 🚀 bjp@google.com wrote:
Can you upgrade your TF build? TFP 0.9 is compatible with TF 2.1
Brian Patton | Software Engineer | [email protected]
On Tue, Jan 28, 2020 at 12:31 AM GauravRaturi notifications@github.com
wrote:Still getting the module 'TensorFlow._api.v1.compat' has no attribute
'v2' error. I have TensorFlow version 1.13.1 and TensorFlow probability
0.9.0. Kindly give the solution.—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/tensorflow/probability/issues/354?email_source=notifications&email_token=AFJFSIZUOI4MADWSLA7SDQ3Q767MHA5CNFSM4HED2R52YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEKCCYZQ#issuecomment-579087462,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AFJFSI5M3AKS4JGMSBMQBS3Q767MHANCNFSM4HED2R5Q
.
hi, i had the same problem,Has the problem been solved?
hi, i had the same problem,Has the problem been solved?
Yes, the problem has solved I updated by TensorFlow to 1.15.0. Let me know if the problem persists.
Update the CUDA and CuDNN to the suitable version if you are using GPU version. I have used TensorFlow-cpu==1.15.0.
i sovled the problem by the way you told me.
Someone solved by downloading this version of models since we are using TF 1.13
@fkhjoy after downloading it, where should i put the models-1.13.0 folder to solve this please???
@fkhjoy after downloading it, where should i put the models-1.13.0 folder to solve this please???
Where your tensorflow is installed
In my case it's ..\Lib\site-packages\tensorflow\
In this directory my models is located. Just put it there.
@fkhjoy after downloading it, where should i put the models-1.13.0 folder to solve this please???
Where your tensorflow is installed
In my case it's ..\Lib\site-packages\tensorflow
In this directory my models is located. Just put it there.
why some files are corrupted when extracting files? And I just need put this folder in the directionary ..\Lib\site-packages\tensorflow? It didn't seem to work.
@fkhjoy after downloading it, where should i put the models-1.13.0 folder to solve this please???
Where your tensorflow is installed
In my case it's ..\Lib\site-packages\tensorflow
In this directory my models is located. Just put it there.why some files are corrupted when extracting files? And I just need put this folder in the directionary ..\Lib\site-packages\tensorflow? It didn't seem to work.
Extract in different directory and copy-paste it to the desired directory. There is no reason to be corrupted. Try from this link
@fkhjoy after downloading it, where should i put the models-1.13.0 folder to solve this please???
Where your tensorflow is installed
In my case it's ..\Lib\site-packages\tensorflow
In this directory my models is located. Just put it there.why some files are corrupted when extracting files? And I just need put this folder in the directionary ..\Lib\site-packages\tensorflow? It didn't seem to work.
Extract in different directory and copy-paste it to the desired directory. There is no reason to be corrupted. Try from this link
I downloaded the 1.13.0 model again. And it works well. May be some error occurred during last download.