【发布时间】:2021-01-03 00:27:08
【问题描述】:
我知道 Keras-contrib 已弃用并已迁移到 tensorflow/addons,但我不明白如何使用这个新库添加 CRF 层。
有谁知道哪个 tensorflow/addons 功能相当于 keras-contrib CRF 层?
【问题讨论】:
标签: python tensorflow machine-learning
我知道 Keras-contrib 已弃用并已迁移到 tensorflow/addons,但我不明白如何使用这个新库添加 CRF 层。
有谁知道哪个 tensorflow/addons 功能相当于 keras-contrib CRF 层?
【问题讨论】:
标签: python tensorflow machine-learning
您可以使用 TensorFlow 插件(tfa)。在你的情况下使用tfa.layers.CRF。
要使用上面的,首先你必须安装最新版本,如下所示
pip install tensorflow-addons
您可以使用如下所示的插件
import tensorflow as tf
import tensorflow_addons as tfa
from tensorflow_addons.layers import CRF
更多信息可以参考here
【讨论】: