【问题标题】:Updating Tensorflow Distributions to Tensorflow Probability将 TensorFlow 分布更新为 TensorFlow 概率
【发布时间】:2019-06-07 23:50:41
【问题描述】:

正如标题所说,我想将 Tensorflow Distributions 更新为 Tensorflow Probability。我正在按照本教程从源代码构建 Tensorflow。 https://medium.com/searce/installing-tensorflow-gpu-with-nvidia-cuda-on-a-google-cloud-platform-vm-instance-b059ea47e55c

当我尝试使用 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`.

由于我是从资源构建 Tensorflow 的新手,因此我尝试准确搜索如何执行此操作,但无法获得足够的信息。

init.py 文件中,它说

"""表示统计分布的类和使用它们的操作。 请改用tfp.distributions。 """

这是否意味着我应该将 Tensorflow Probability 中的所有文件添加到我当前的 tensorflow 文件夹中?并重写初始化文件删除已弃用的 Tensorflow 分布?我不确定我到底要做什么。

如果您能给我有关如何执行此操作或与此问题相关的任何内容的资源,那将很有帮助。

谢谢。

【问题讨论】:

    标签: tensorflow build


    【解决方案1】:

    当您完成从源代码构建 TF 后,您将留下一个需要安装 pip 的 .whl 文件。然后,您还应该 pip install tfp-nightly 这是 TF Probability 的每晚打包。您还可以按照 TFP GitHub 页面上的说明从源代码安装 TFP。请注意,如果您只需要这两个软件包的最新功能,只需安装 tf-nightly 和 tfp-nightly 将非常接近源代码构建。如果您想修改 TF 库,那么从源代码构建是可行的方法。

    希望这会有所帮助!

    【讨论】:

    • 好的。谢谢。那我应该使用 tfp-nightly。
    猜你喜欢
    • 2019-02-26
    • 2017-11-02
    • 1970-01-01
    • 1970-01-01
    • 2019-10-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多