LSTM - Elmo from TF-Hub with TF2.0 pure implementation

I have the following problem mainly due to my lack of expertise with TF in general and TF2.0 in particular.

I try to use Elmo embedding with a keras LSTM implementation.

The code that I am inspired from is using the TF-Hub Elmo module. Which appears to be quite difficult to use if I want to write a 100% TF2.0 Python code.

This is what I have done :

Elmo Embedding class from Tf-Hub

Elmo LSTM tf.function

The last call is producting the following error:

Runtime error

Upvotes: 2

Views: 1408

Answers (1)

msa
msa

Reputation: 725

I had the same issue and just resolved to using tensorflow 1.15 instead which is compatible with tensorflow-hub.

Otherwise you could maybe look into this:

https://www.tensorflow.org/hub/migration_tf2

Upvotes: 2

Related Questions