tensorflow / hub

A library for transfer learning by reusing parts of TensorFlow models.
https://tensorflow.org/hub
Apache License 2.0
3.49k stars 1.67k forks source link

Stuck when loading Module? #265

Closed hamzaLeb closed 5 years ago

hamzaLeb commented 5 years ago

Hi, I tried the tutorial at https://colab.research.google.com/github/tensorflow/hub/blob/master/examples/colab/semantic_similarity_with_tf_hub_universal_encoder.ipynb#scrollTo=zwty8Z6mAkdV and everything works great. But when I am on my local machine (MacOS) the following code stucks/freezes infinitely:

import tensorflow_hub as hub
module_url = "https://tfhub.dev/google/universal-sentence-encoder-large/3" 
embed = hub.Module(module_url)

I tried the suggested solution I found on the web to add the TFHUB_CACHE_DIR variable but the problem persists:

import os
import tensorflow_hub as hub
os.environ['TFHUB_CACHE_DIR'] = '/Path/To/A/Standard/Local/Directory'
module_url = "https://tfhub.dev/google/universal-sentence-encoder-large/3" 
embed = hub.Module(module_url)

Can anyone help me please?

Harshini-Gadige commented 5 years ago

This is some what related to https://github.com/tensorflow/hub/issues/261. Also request you to post your observations there which help us to maintain a single issue and follow up easily.