The `tensorflow_hub` library maintainers has made it every easy for users to download and use the pre-trained tensorflow modules, e.g.:

```
import tensorflow_hub as hub

embed = hub.Module("https://tfhub.dev/google/universal-sentence-encoder/1")

```

But from the `sys.stderr` it seemed like it was saving the module locally to a temporary directory, i.e.

> 
> INFO:tensorflow:Using
>  /var/folders/j6/xczfl75n3sbfwpg4190gpb104vnlxt/T/tfhub\_modules to
>  cache modules. INFO:tensorflow:Initialize variable
>  module/Embeddings\_en/sharded\_0:0 from checkpoint
>  b'/var/folders/j6/xczfl75n3sbfwpg4190gpb104vnlxt/T/tfhub\_modules/c6f5954ffa065cdb2f2e604e740e8838bf21a2d3/variables/variables' with Embeddings\_en/sharded\_0 INFO:tensorflow:Initialize variable
>  module/Embeddings\_en/sharded\_1:0 from checkpoint
>  b'/var/folders/j6/xczfl75n3sbfwpg4190gpb104vnlxt/T/tfhub\_modules/c6f5954ffa065cdb2f2e604e740e8838bf21a2d3/variables/variables' with Embeddings\_en/sharded\_1 INFO:tensorflow:Initialize variable
>  module/Embeddings\_en/sharded\_10:0 from checkpoint
>  b'/var/folders/j6/xczfl75n3sbfwpg4190gpb104vnlxt/T/tfhub\_modules/c6f5954ffa065cdb2f2e604e740e8838bf21a2d3/variables/variables' with Embeddings\_en/sharded\_10 INFO:tensorflow:Initialize variable
>  module/Embeddings\_en/sharded\_11:0 from checkpoint
>  b'/var/folders/j6/xczfl75n3sbfwpg4190gpb104vnlxt/T/tfhub\_modules/c6f5954ffa065cdb2f2e604e740e8838bf21a2d3/variables/variables' with Embeddings\_en/sharded\_11 INFO:tensorflow:Initialize variable
>  module/Embeddings\_en/sharded\_12:0 from checkpoint
>  b'/var/folders/j6/xczfl75n3sbfwpg4190gpb104vnlxt/T/tfhub\_modules/c6f5954ffa065cdb2f2e604e740e8838bf21a2d3/variables/variables' with Embeddings\_en/sharded\_12 INFO:tensorflow:Initialize variable
>  module/Embeddings\_en/sharded\_13:0 from checkpoint
>  b'/var/folders/j6/xczfl75n3sbfwpg4190gpb104vnlxt/T/tfhub\_modules/c6f5954ffa065cdb2f2e604e740e8838bf21a2d3/variables/variables' with Embeddings\_en/sharded\_13 INFO:tensorflow:Initialize variable
>  module/Embeddings\_en/sharded\_14:0 from checkpoint
>  b'/var/folders/j6/xczfl75n3sbfwpg4190gpb104vnlxt/T/tfhub\_modules/c6f5954ffa065cdb2f2e604e740e8838bf21a2d3/variables/variables' with Embeddings\_en/sharded\_14 INFO:tensorflow:Initialize variable
>  module/Embeddings\_en/sharded\_15:0 from checkpoint
>  b'/var/folders/j6/xczfl75n3sbfwpg4190gpb104vnlxt/T/tfhub\_modules/c6f5954ffa065cdb2f2e604e740e8838bf21a2d3/variables/variables' with Embeddings\_en/sharded\_15 INFO:tensorflow:Initialize variable
>  module/Embeddings\_en/sharded\_16:0 from checkpoint
>  b'/var/folders/j6/xczfl75n3sbfwpg4190gpb104vnlxt/T/tfhub\_modules/c6f5954ffa065cdb2f2e604e740e8838bf21a2d3/variables/variables' with Embeddings\_en/sharded\_16 INFO:tensorflow:Initialize variable
>  module/Embeddings\_en/sharded\_2:0 from checkpoint
>  b'/var/folders/j6/xczfl75n3sbfwpg4190gpb104vnlxt/T/tfhub\_modules/c6f5954ffa065cdb2f2e604e740e8838bf21a2d3/variables/variables' with Embeddings\_en/sharded\_2 INFO:tensorflow:Initialize variable
>  module/Embeddings\_en/sharded\_3:0 from checkpoint
>  b'/var/folders/j6/xczfl75n3sbfwpg4190gpb104vnlxt/T/tfhub\_modules/c6f5954ffa065cdb2f2e604e740e8838bf21a2d3/variables/variables' with Embeddings\_en/sharded\_3 INFO:tensorflow:Initialize variable
>  module/Embeddings\_en/sharded\_4:0 from checkpoint
>  b'/var/folders/j6/xczfl75n3sbfwpg4190gpb104vnlxt/T/tfhub\_modules/c6f5954ffa065cdb2f2e604e740e8838bf21a2d3/variables/variables' with Embeddings\_en/sharded\_4 INFO:tensorflow:Initialize variable
>  module/Embeddings\_en/sharded\_5:0 from checkpoint
>  b'/var/folders/j6/xczfl75n3sbfwpg4190gpb104vnlxt/T/tfhub\_modules/c6f5954ffa065cdb2f2e604e740e8838bf21a2d3/variables/variables' with Embeddings\_en/sharded\_5 INFO:tensorflow:Initialize variable
>  module/Embeddings\_en/sharded\_6:0 from checkpoint
>  b'/var/folders/j6/xczfl75n3sbfwpg4190gpb104vnlxt/T/tfhub\_modules/c6f5954ffa065cdb2f2e604e740e8838bf21a2d3/variables/variables' with Embeddings\_en/sharded\_6 INFO:tensorflow:Initialize variable
>  module/Embeddings\_en/sharded\_7:0 from checkpoint
>  b'/var/folders/j6/xczfl75n3sbfwpg4190gpb104vnlxt/T/tfhub\_modules/c6f5954ffa065cdb2f2e604e740e8838bf21a2d3/variables/variables' with Embeddings\_en/sharded\_7 INFO:tensorflow:Initialize variable
>  module/Embeddings\_en/sharded\_8:0 from checkpoint
>  b'/var/folders/j6/xczfl75n3sbfwpg4190gpb104vnlxt/T/tfhub\_modules/c6f5954ffa065cdb2f2e604e740e8838bf21a2d3/variables/variables' with Embeddings\_en/sharded\_8 INFO:tensorflow:Initialize variable
>  module/Embeddings\_en/sharded\_9:0 from checkpoint
>  b'/var/folders/j6/xczfl75n3sbfwpg4190gpb104vnlxt/T/tfhub\_modules/c6f5954ffa065cdb2f2e604e740e8838bf21a2d3/variables/variables' with Embeddings\_en/sharded\_9 INFO:tensorflow:Initialize variable
>  module/Encoder\_en/DNN/ResidualHidden\_0/weights:0 from checkpoint
>  b'/var/folders/j6/xczfl75n3sbfwpg4190gpb104vnlxt/T/tfhub\_modules/c6f5954ffa065cdb2f2e604e740e8838bf21a2d3/variables/variables' with Encoder\_en/DNN/ResidualHidden\_0/weights
>  INFO:tensorflow:Initialize variable
>  module/Encoder\_en/DNN/ResidualHidden\_1/weights:0 from checkpoint
>  b'/var/folders/j6/xczfl75n3sbfwpg4190gpb104vnlxt/T/tfhub\_modules/c6f5954ffa065cdb2f2e604e740e8838bf21a2d3/variables/variables' with Encoder\_en/DNN/ResidualHidden\_1/weights
>  INFO:tensorflow:Initialize variable
>  module/Encoder\_en/DNN/ResidualHidden\_2/weights:0 from checkpoint
>  b'/var/folders/j6/xczfl75n3sbfwpg4190gpb104vnlxt/T/tfhub\_modules/c6f5954ffa065cdb2f2e604e740e8838bf21a2d3/variables/variables' with Encoder\_en/DNN/ResidualHidden\_2/weights
>  INFO:tensorflow:Initialize variable
>  module/Encoder\_en/DNN/ResidualHidden\_3/projection:0 from checkpoint
>  b'/var/folders/j6/xczfl75n3sbfwpg4190gpb104vnlxt/T/tfhub\_modules/c6f5954ffa065cdb2f2e604e740e8838bf21a2d3/variables/variables' with Encoder\_en/DNN/ResidualHidden\_3/projection
>  INFO:tensorflow:Initialize variable
>  module/Encoder\_en/DNN/ResidualHidden\_3/weights:0 from checkpoint
>  b'/var/folders/j6/xczfl75n3sbfwpg4190gpb104vnlxt/T/tfhub\_modules/c6f5954ffa065cdb2f2e604e740e8838bf21a2d3/variables/variables' with Encoder\_en/DNN/ResidualHidden\_3/weights
>  INFO:tensorflow:Initialize variable
>  module/SHARED\_RANK\_ANSWER/response\_encoder\_0/tanh\_layer\_0/bias:0 from
>  checkpoint
>  b'/var/folders/j6/xczfl75n3sbfwpg4190gpb104vnlxt/T/tfhub\_modules/c6f5954ffa065cdb2f2e604e740e8838bf21a2d3/variables/variables' with SHARED\_RANK\_ANSWER/response\_encoder\_0/tanh\_layer\_0/bias
>  INFO:tensorflow:Initialize variable
>  module/SHARED\_RANK\_ANSWER/response\_encoder\_0/tanh\_layer\_0/weights:0
>  from checkpoint
>  b'/var/folders/j6/xczfl75n3sbfwpg4190gpb104vnlxt/T/tfhub\_modules/c6f5954ffa065cdb2f2e604e740e8838bf21a2d3/variables/variables' with SHARED\_RANK\_ANSWER/response\_encoder\_0/tanh\_layer\_0/weights
>  INFO:tensorflow:Initialize variable
>  module/SHARED\_RANK\_ANSWER/response\_encoder\_0/tanh\_layer\_1/bias:0 from
>  checkpoint
>  b'/var/folders/j6/xczfl75n3sbfwpg4190gpb104vnlxt/T/tfhub\_modules/c6f5954ffa065cdb2f2e604e740e8838bf21a2d3/variables/variables' with SHARED\_RANK\_ANSWER/response\_encoder\_0/tanh\_layer\_1/bias
>  INFO:tensorflow:Initialize variable
>  module/SHARED\_RANK\_ANSWER/response\_encoder\_0/tanh\_layer\_1/weights:0
>  from checkpoint
>  b'/var/folders/j6/xczfl75n3sbfwpg4190gpb104vnlxt/T/tfhub\_modules/c6f5954ffa065cdb2f2e604e740e8838bf21a2d3/variables/variables' with SHARED\_RANK\_ANSWER/response\_encoder\_0/tanh\_layer\_1/weights
>  INFO:tensorflow:Initialize variable
>  module/SHARED\_RANK\_ANSWER/response\_encoder\_0/tanh\_layer\_2/bias:0 from
>  checkpoint
>  b'/var/folders/j6/xczfl75n3sbfwpg4190gpb104vnlxt/T/tfhub\_modules/c6f5954ffa065cdb2f2e604e740e8838bf21a2d3/variables/variables' with SHARED\_RANK\_ANSWER/response\_encoder\_0/tanh\_layer\_2/bias
>  INFO:tensorflow:Initialize variable
>  module/SHARED\_RANK\_ANSWER/response\_encoder\_0/tanh\_layer\_2/weights:0
>  from checkpoint
>  b'/var/folders/j6/xczfl75n3sbfwpg4190gpb104vnlxt/T/tfhub\_modules/c6f5954ffa065cdb2f2e604e740e8838bf21a2d3/variables/variables' with SHARED\_RANK\_ANSWER/response\_encoder\_0/tanh\_layer\_2/weights
>  INFO:tensorflow:Initialize variable
>  module/SNLI/Classifier/LinearLayer/bias:0 from checkpoint
>  b'/var/folders/j6/xczfl75n3sbfwpg4190gpb104vnlxt/T/tfhub\_modules/c6f5954ffa065cdb2f2e604e740e8838bf21a2d3/variables/variables' with SNLI/Classifier/LinearLayer/bias INFO:tensorflow:Initialize
>  variable module/SNLI/Classifier/LinearLayer/weights:0 from checkpoint
>  b'/var/folders/j6/xczfl75n3sbfwpg4190gpb104vnlxt/T/tfhub\_modules/c6f5954ffa065cdb2f2e604e740e8838bf21a2d3/variables/variables' with SNLI/Classifier/LinearLayer/weights INFO:tensorflow:Initialize
>  variable module/SNLI/Classifier/tanh\_layer\_0/bias:0 from checkpoint
>  b'/var/folders/j6/xczfl75n3sbfwpg4190gpb104vnlxt/T/tfhub\_modules/c6f5954ffa065cdb2f2e604e740e8838bf21a2d3/variables/variables' with SNLI/Classifier/tanh\_layer\_0/bias INFO:tensorflow:Initialize
>  variable module/SNLI/Classifier/tanh\_layer\_0/weights:0 from checkpoint
>  b'/var/folders/j6/xczfl75n3sbfwpg4190gpb104vnlxt/T/tfhub\_modules/c6f5954ffa065cdb2f2e604e740e8838bf21a2d3/variables/variables' with SNLI/Classifier/tanh\_layer\_0/weights INFO:tensorflow:Initialize
>  variable module/global\_step:0 from checkpoint
>  b'/var/folders/j6/xczfl75n3sbfwpg4190gpb104vnlxt/T/tfhub\_modules/c6f5954ffa065cdb2f2e604e740e8838bf21a2d3/variables/variables' with global\_step
> 
> 
> 

After a machine reboot, the module gets deleted and running the `hub.Module('...')` code again would re-download the module. 

**Is is possible to save the module to a custom directory and afterwards load from the custom directory?**

If it's possible, **how to save/load a tensorflow hub module to/from a custom path?**