简体   繁体   English

将Tensorflow分布更新为Tensorflow概率

[英]Updating Tensorflow Distributions to Tensorflow Probability

As the title says, I would like to update Tensorflow Distributions to Tensorflow Probability. 如标题所示,我想将Tensorflow发行版更新为Tensorflow概率。 I'm following this tutorial to build Tensorflow from source. 我正在按照本教程从源代码构建Tensorflow。 https://medium.com/searce/installing-tensorflow-gpu-with-nvidia-cuda-on-a-google-cloud-platform-vm-instance-b059ea47e55c 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. 当我尝试使用bazel构建tensorflow时,收到此警告。

    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. 由于我是不熟悉从资源构建Tensorflow的人,因此我尝试确切地搜索如何执行此操作,但是我无法获得足够的信息。

In the init .py file, it says init .py文件中,它说

"""Classes representing statistical distributions and ops for working with them. Use tfp.distributions instead. """ “”“代表统计分布和使用它们的类。请改用tfp.distributions 。”“”

Does this mean I should add all files in Tensorflow Probability to my current tensorflow folders? 这是否意味着我应该将Tensorflow Probability中的所有文件添加到当前的tensorflow文件夹中? and rewrite init file deleting deprecated Tensorflow Distributions? 并重写init文件以删除不赞成使用的Tensorflow发行版? 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. 从源代码完成TF构建后,将剩下一个需要pip安装的.whl文件。 You should then also pip install tfp-nightly which is the nightly packaging of TF Probability. 然后,您还应该每晚安装pf-tfp,这是TF概率的每晚包装。 You could also follow the instructions on the TFP GitHub page for installing TFP from source. 您也可以按照TFP GitHub页面上的说明从源代码安装TFP。 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. 请注意,如果您想要的只是这两个软件包的最新功能,则仅安装tf-nightly和tfp-nightly将非常接近源代码构建。 If you want to modify the TF library then building from source is the way to go. 如果您想修改TF库,那么从源代码构建是一种方法。

Hope this helps! 希望这可以帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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