【问题标题】:Seq2Seq Training helper module in tensorflow张量流中的 Seq2Seq 训练助手模块
【发布时间】:2020-02-22 22:46:26
【问题描述】:

在最新的 tf 2.0 更新中,tensorflow 从框架中移除了 contrib 模块。以为他们已经补偿了 tf.compat.v1 中的大部分功能,但我找不到 tf.contrib.seq2seq.BasicDecoder 、 tf.contrib.seq2seq.dynamic_decode 、 tf.contrib 等功能的替代品。 seq2seq.GreedyEmbeddingHelper 和 tf.contrib.seq2seq.TrainingHelper。 如何在我的模型中使用这些函数?

【问题讨论】:

    标签: python keras tensorflow2.0


    【解决方案1】:

    查看 TensorFlow-Addons:

    https://github.com/tensorflow/addons,

    https://www.tensorflow.org/addons/api_docs/python/tfa/seq2seq?hl=en

    你要找的功能都在那里。

    pip install tensorflow-addons
    

    然后:

    import tensorflow as tf
    import tensorflow_addons as tfa
    

    【讨论】:

    • 但我无法在 windows 上安装插件
    猜你喜欢
    • 2017-09-22
    • 2020-02-29
    • 1970-01-01
    • 2021-12-24
    • 2023-03-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多