Universal Sentence Encoder module loading stall

298 views
Skip to first unread message

Aaron Tuor

unread,
Apr 10, 2018, 11:01:44 AM4/10/18
to TensorFlow Hub
Loading the ELMo model is pretty fast: 
elmo = hub.Module("https://tfhub.dev/google/elmo/1", trainable=True)

but the universal sentence encoder module doesn't load for me:

 Can someone check to make sure this is working properly?

Thanks,
Aaron

George Sterpu

unread,
Apr 10, 2018, 11:10:05 AM4/10/18
to Aaron Tuor, TensorFlow Hub
Yes, it works here, now. This is a large 1GB model however, is there any progress in /tmp/tfhub_modules/* ?

--
You received this message because you are subscribed to the Google Groups "TensorFlow Hub" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hub+uns...@tensorflow.org.
Visit this group at https://groups.google.com/a/tensorflow.org/group/hub/.

Aaron Tuor

unread,
Apr 10, 2018, 11:47:55 AM4/10/18
to george...@gmail.com, TensorFlow Hub
Ok, I will check. 

s...@carlabs.com

unread,
Apr 17, 2018, 1:53:40 AM4/17/18
to TensorFlow Hub
When I run
I get the following error, at the bottom of a 10 deep stack
KeyError: "The name 'global_step:0' refers to a Tensor which does not exist. The operation, 'global_step', does not exist in the graph."

Sorry if this isn't the right place for this, but it is happening directly from the example colab notebook, so I don't see how it could be user error. Though it probably still is.

Abhishek Singh

unread,
Apr 17, 2018, 5:38:14 AM4/17/18
to TensorFlow Hub
Got the same error too. If anything works for you do post.

André Susano Pinto

unread,
Apr 17, 2018, 5:52:59 AM4/17/18
to Abhishek Singh, TensorFlow Hub
Thanks for reporting... this is related with tensorflow pre-release "1.8.0rc0".. I will investigate further and update.
For now you can manually fallback to tensorflow 1.7.0 (You might need to restart your runtime for it to work).

Abhishek Singh

unread,
Apr 17, 2018, 5:56:33 AM4/17/18
to André Susano Pinto, TensorFlow Hub
Thanks a lot.

André Susano Pinto

unread,
Apr 17, 2018, 11:15:25 AM4/17/18
to Abhishek Singh, TensorFlow Hub
Hi all,

This turned out to be a issue with tensorflow-1.8.0rc0 and not with tensorflow-hub package.
Stick with "pip install tensorflow==1.7.0" until there is a new release candidate.

--
André

Abhishek Singh

unread,
Apr 18, 2018, 10:44:58 AM4/18/18
to André Susano Pinto, TensorFlow Hub
Hi all, 
Are there any licensing terms involved. I mean can I use all those pre trained weights commercially.

André Susano Pinto

unread,
Apr 18, 2018, 10:54:11 AM4/18/18
to Abhishek Singh, TensorFlow Hub
That is off-topic from this thread about the module failing to load. See https://github.com/tensorflow/hub/issues/12 instead.

rajeev gupta

unread,
Apr 26, 2018, 1:46:29 AM4/26/18
to TensorFlow Hub, aaro...@gmail.com, george...@gmail.com
Whenever I run this module it takes very long to run even a test program. Why doesn't it cache the module rather than loading every time? Is there any way to download the module and refer the local file system location instead of the url?

-Rajeev

Andrew Gasparovic

unread,
Apr 26, 2018, 3:18:56 AM4/26/18
to rajeev gupta, TensorFlow Hub, aaro...@gmail.com, george...@gmail.com
Hi Rajeev,

In fact, TF Hub does cache modules! Check out the section "Caching Modules" here:

The issue is that it will use a temp location, which may not be retained between runs. You can control the cache location using the TFHUB_CACHE_DIR environment variable. Thanks!
--
/A

rajeev gupta

unread,
Apr 26, 2018, 4:12:51 AM4/26/18
to Andrew Gasparovic, TensorFlow Hub, aaro...@gmail.com, george...@gmail.com
Thanks for replying Andrew. I am using some other location for caching. Seems most of the time is going in calculating embedding for each sentence. The test run has 10 sentences and it takes around 5 minutes to get their embeddings.

-Rajeev
--
Thanks and Regards,
Rajeev Gupta
Reply all
Reply to author
Forward
0 new messages