我正在使用 ELMO 为我的数据集创建嵌入,我总是收到此错误:
embed=elmo(data,signature="default",as_dict=True)["elmo"]
TypeError: 'AutoTrackable' object is not callable
我的代码就这么简单:
import tensorflow_hub as hub
import tensorflow as tf
elmo = hub.load("https://tfhub.dev/google/elmo/3")
embeddings = elmo(
["the cat is on the mat", "dogs are in the fog"],
signature="default",
as_dict=True)["elmo"]