Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TFP Layers support in TF2 #630

Open
nbro opened this issue Oct 29, 2019 · 4 comments
Open

TFP Layers support in TF2 #630

nbro opened this issue Oct 29, 2019 · 4 comments

Comments

@nbro
Copy link
Contributor

nbro commented Oct 29, 2019

I've already come across different problems related to the eager execution of the TensorFlow code that involves this package. For example, #620 (an issue I had opened and that I've not yet solved) and #629. So, does TensorFlow probability officially support TensorFlow 2 and eager execution? If not, it is time to update and upgrade this package.

@brianwa84
Copy link
Contributor

brianwa84 commented Oct 30, 2019

TF2 is certainly supported and encouraged, and we mostly expect TFP to work. TFP uses a lot of small ops and still doesn't internally use tf.function, so I expect some speedups when we are able to then that on widely. Thanks for filing what you have so far. We're not a huge team, and especially the layers library has been underloved lately, so please keep reporting issues as you encounter them.

@nbro
Copy link
Contributor Author

nbro commented Oct 30, 2019

@brianwa84 Does it also support Keras or, at least, did you have Keras in mind when you developed it? I am particularly interested in using Keras with TensorFlow probability. In fact, the issue I had mentioned above, #620, is about a script that attempts to use Keras and TensorFlow probability. If it officially supports Keras, if you could provide examples of programs (especially, a Bayesian CNN, the example https://github.com/tensorflow/probability/blob/master/tensorflow_probability/examples/bayesian_neural_network.py, but with Keras) that uses TensorFlow probability and Keras (to build, train and test the models), I would really appreciate.

@dynamicwebpaige
Copy link
Contributor

@nbro TensorFlow Probability supports tf.keras layers and initializers, but I agree that this could be better documented - am not seeing an example tutorial on the TFP website.

Thank you for the suggestion! 🙂

@martinwicke

@dynamicwebpaige dynamicwebpaige added the tensorflow 2.0 Issues related to TF 2.0. label Nov 9, 2019
@nbro
Copy link
Contributor Author

nbro commented Dec 10, 2019

Meanwhile, I've found another similar issue: #416.

@srvasude srvasude changed the title Does TensorFlow probability officially support TensorFlow 2 and eager execution? TFP Layers support in TF2 Feb 8, 2020
nbro referenced this issue Apr 26, 2020
…_tf_function=True` - Make `_DenseVariational` layers eager compatible.

PiperOrigin-RevId: 264872770
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants