rs-station / careless

Merge X-ray diffraction data with Wilson's priors, variational inference, and metadata
MIT License
16 stars 6 forks source link

update to tensorflow 2.16 #157

Closed kmdalton closed 6 months ago

kmdalton commented 7 months ago

TensorFlow Probability 0.24.0 upgrades to TensorFlow version 2.16. From the release notes, a substantial change in distribution had to be made to allow this. The tf pypi package now ships with Keras version 3 which is a total rewrite to support other backends (PyTorch & JAX). This is a breaking change for the tfp.layers submodule. I think this is probably because Keras 3 enforces that layers return tensors and not abstract things like distributions. To mitigate this, tfp now ships a separate tensorflow-probability[tfp] pypi release which retains support for tfp.layers. This relies on the tf_keras package which is Keras 2.

To support tfp v0.24.0, I had to make a number of changes.