I'm trying to get started with using Elmo with Keras & Tensorflow. On running the code below I'm getting an error that seems like the weights aren't initialized. I have also tried defining ElmoLayer class as it's defined here ([link](https://github.com/strongio/keras-elmo/blob/master/Elmo%20Keras.ipynb)), but still the same error.

Any idea what I'm doing wrong?

```
def ElmoEmbeddingLayer(x):
    print(x.shape)
    module = hub.Module("https://tfhub.dev/google/elmo/3", trainable=False)
    embeddings = module(tf.squeeze(tf.cast(x, tf.string)), signature="default", as_dict=True)["elmo"]
    return embeddings

def build_model(): 
    input_text = Input(shape=(1,), dtype="string")
    #embedding = ElmoEmbeddingLayer()(input_text)
    embedding = Lambda(ElmoEmbeddingLayer, output_shape=(1,1024))(input_text)

    dense = Dense(256, activation='relu')(embedding)    
    dense = Flatten()(dense)
    pred = Dense(3, activation='sigmoid')(dense)

    model = Model(inputs=[input_text], outputs=pred)

    model.compile(loss='binary_crossentropy', optimizer='adam', metrics=['accuracy'])
    model.summary()

    return model

```

> 
> FailedPreconditionError: Error while reading resource variable
> module/bilm/RNN\_0/RNN/MultiRNNCell/Cell0/rnn/lstm\_cell/projection/kernel
> from Container: localhost. This could mean that the variable was
> uninitialized. Not found: Resource
> localhost/module/bilm/RNN\_0/RNN/MultiRNNCell/Cell0/rnn/lstm\_cell/projection/kernel/class
> tensorflow::Var does not exist. [[node
> lambda\_1/module\_apply\_default/bilm/RNN\_0/RNN/MultiRNNCell/Cell0/rnn/lstm\_cell/projection/kernel/Read/ReadVariableOp
> (defined at
> C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\_core\python\framework\ops.py:1751)
> ]] [Op:\_\_inference\_keras\_scratch\_graph\_5942]
> 
> 
> Function call stack: keras\_scratch\_graph
> 
> 
> 

My Keras and TF versions:

```
print(keras.__version__)
2.3.1

print(tf.__version__)
2.0.0

```