我一直在使用 tensorflow 做一些 NLP,并且一直在使用 tf.contrib.lookup.index_table_from_tensor 为 token 创建查找表。
我知道 tensorflow 将在 2019 年 Spring 推出 2.0,他们说:
“tf.contrib
TensorFlow 的 contrib 模块已经超出了单个存储库中可以维护和支持的范围。较大的项目最好单独维护,而我们将与主要的 TensorFlow 代码一起孵化较小的扩展。因此,作为发布 TensorFlow 2.0 的一部分,我们将停止分发 tf.contrib。在接下来的几个月里,我们将与各自的所有者合作制定详细的迁移计划,包括如何在我们的社区页面和文档中宣传您的 TensorFlow 扩展。对于每个 contrib 模块,我们将 a) 将项目集成到 TensorFlow 中; b) 将其移至单独的存储库或 c) 将其完全删除。这确实意味着所有 tf.contrib 都将被弃用,我们今天将停止添加新的 tf.contrib 项目。我们正在为目前在 tf.contrib 中的许多项目寻找所有者/维护者,如果您有兴趣,请联系我们(回复此电子邮件)。”
那么两个问题:
1) 是否有其他方法可以在 Tensorflow 中轻松构建查找表?
2) 我无法确定此功能包含在 2.0 中的可能性有多大。有什么迹象吗?
谢谢!
请您参考如下方法:
- 您应该能够在 tensorflow 2.0 下使用
lookup功能。 tensorflow.contrib.lookup将在tensorflow 2.0之后移至核心
根据 https://github.com/tensorflow/community/blob/master/rfcs/20180907-contrib-sunset.md#list-of-projects .
List of Projects This section lists the possible fate of all projects currently in tf.contrib. The decisions here are preliminary, not all owners have been contacted (those marked with a * have not). Named in parentheses are people with a potential interest in this, but who are not owners.
If you have an interest in one of these projects and are not named as an owner (or as an interested party), please speak up. I've added some (tentative) move targets to as of yet nonexistent repositories: tensorflow/io, tensorflow/contrib (I would prefer a better name for this), and tensorflow/scientific will all require new SIGs to maintain them.
Note that any project that has no other fate specified (including those moving to a repo tentatively maintained by a SIG, but for which no SIG is actually formed) will be deleted by default at 2.0.
