i'm using ELMO to create embeddings for my dataset, i always get this error:
embed=elmo(data,signature="default",as_dict=True)["elmo"]
TypeError: 'AutoTrackable' object is not callable
my code is as simple as this:
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"]
The problem is with the TensorFlow version. ELMo doesn't work with tensorflow 2, please refer TensorFlow Hub documentation to check the text embeddings supported in version 1 and version 2. Running the same code after changing the TensorFlow version to 1.15 will do the trick. You should also use hub.Module() with version 1(instead of hub.load). Please refer this post to see how to change the version.