【问题标题】:What is the purpose of the tf.contrib module in Tensorflow?Tensorflow 中 tf.contrib 模块的用途是什么?
【发布时间】:2018-07-09 06:55:30
【问题描述】:

我很好奇tf.contrib 是什么,以及为什么代码会包含在 TensorFlow 中,但不会包含在主存储库中。

此外,查看示例here(来自tensorflow master 分支),我想找到tf.contrib.layers.sparse_column_with_hash_bucket 的来源。

这似乎是一些很酷的例程,但我想确保它们正确使用队列等,用于预取/预处理示例,以便在生产环境中实际使用它们。

它似乎记录在 here 中,但它来自 tflearn 项目,但 tf.contrib.layers.sparse_column_with_hash_bucket 似乎也不在该存储库中。

【问题讨论】:

    标签: python tensorflow


    【解决方案1】:

    一般来说,tf.contrib 包含 contribute 代码。它旨在包含最终应合并到核心 TensorFlow 中的功能和贡献,但其接口可能仍会发生变化,或者需要进行一些测试以查看它们是否可以得到更广泛的接受。

    Tensorflow 团队不支持tf.contrib 中的代码。收录是希望对您有所帮助,但可能随时更改或删除;没有任何保证。

    tf.contrib.layers.sparse_column_with_hash_bucket的来源可以在

    https://github.com/tensorflow/tensorflow/blob/master/tensorflow/contrib/layers/python/layers/feature_column.py#L365

    【讨论】:

    • contrib 代表 CONTRIButions
    • 我认为有必要指出 tf.contrib 从 2.0.alpha 版本开始已从 Tensorflow 中删除。旧的 tf.contrib 包中的一些功能已移至 tensorflow/addons,但并非全部。对于任何需要将旧的 contrib 功能移植到 TF 2.0 的人,您可能会发现一些有用的信息 here
    • 嘿,tf.contrib 从 TF 2.0 开始被删除。在这种情况下,我们如何为 tensorflow 做出贡献?
    猜你喜欢
    • 1970-01-01
    • 2016-01-10
    • 1970-01-01
    • 2020-06-16
    • 1970-01-01
    • 2020-05-31
    • 1970-01-01
    • 2019-06-13
    • 2016-04-10
    相关资源
    最近更新 更多