allenai / allenai/bilm-tf

hub version elmo with colab tpu runtime produces eorror

Aperta
#203 0 commenti 1 reazione 0 assegnatari Vedi su GitHub
Lingua principale
Python
Stelle
1.6k
Fork
447
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

I'm using the hub version elmo model to do the embedding, like below:

`sess=tf.Session()

K.set_session(sess)

elmo_model = c("https://tfhub.dev/google/elmo/2", trainable=True)

trainX=elmo_model(inputs={"tokens": X_tr,"sequence_len": len_X_tr
},
signature="tokens",
as_dict=True)["elmo"]

sess.run(tf.global_variables_initializer())

sess.run(tf.tables_initializer())

embed_train=sess.run(trainX)`

when i run with GPU runtime type, there's no problem. but when i change the runtime to tpu, it produces errors as following:
InvalidArgumentError (see above for traceback): seq_lens(189) > input.dims(1)
[[node module_apply_tokens/bilm/ReverseSequence (defined at /usr/local/lib/python3.6/dist-packages/tensorflow_hub/native_module.py:547) ]]

Could anyone help me with this? Thanks a lot!

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.