简体   繁体   中英

Updating Tensorflow Distributions to Tensorflow Probability

As the title says, I would like to update Tensorflow Distributions to Tensorflow Probability. I'm following this tutorial to build Tensorflow from source. https://medium.com/searce/installing-tensorflow-gpu-with-nvidia-cuda-on-a-google-cloud-platform-vm-instance-b059ea47e55c

When I tried to build tensorflow using bazel, I get this warning.

    WARNING: /home/tensorflow/tensorflow/contrib/bayesflow/BUILD:17:1: in 
    py_library rule //tensorflow/contrib/bayesflow:bayesflow_py: target 
   '//tensorflow/contrib/bayesflow:bayesflow_py' depends on deprecated 
    target '//tensorflow/contrib/distributions:distributions_py': 
    TensorFlow Distributions has migrated to TensorFlow Probability 
    (https://github.com/tensorflow/probability). Deprecated copies 
    remaining in tf.contrib.distributions are unmaintained, unsupported, 
    and will be removed by late 2018. You should update all usage of 
    `tf.contrib.distributions` to `tfp.distributions`.

Since I was new to building Tensorflow from resource, I tried to search exactly how to do this, but I couldn't get enough information.

In the init .py file, it says

"""Classes representing statistical distributions and ops for working with them. Use tfp.distributions instead. """

Does this mean I should add all files in Tensorflow Probability to my current tensorflow folders? and rewrite init file deleting deprecated Tensorflow Distributions? I'm not sure what exactly I have to do.

If you could give me resources of how to do this or anything related to this problem, that would be helpful.

Thanks.

When you finish building TF from source, you'll be left with a .whl file that needs to be pip installed. You should then also pip install tfp-nightly which is the nightly packaging of TF Probability. You could also follow the instructions on the TFP GitHub page for installing TFP from source. Note that if all you want is recent features of the two packages, simply installing tf-nightly and tfp-nightly will be a very close approximation to a source build. If you want to modify the TF library then building from source is the way to go.

Hope this helps!

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM