Closed rv-ltran closed 3 years ago
@rv-ltran , Can you please let us know if you have tried importing TF Hub as mentioned in this link?
If you have tried executing the commands mentioned in the above link, is it resulting in error, and if so, can you please provide the error log.
I have performed the following commands, and got the errors (attached):
!pip install "tensorflow_hub==0.4.0" !pip install "tf-nightly" import tensorflow as tf import tensorflow_hub as hub
@rv-ltran, I ran your comments in a fresh virtual environment and I could successfully install and import Tensorflow and TF_Hub. Can you create a New Virtual Environment in Anaconda and execute those commands and let me know if your issue is resolved. Thanks!
I opened a new notebook (conda-python3) within AWS Sagemaker , and ran these cmmds but still receiving the errors (attached). Did I follow your instruction correctly?
In general we haven't looked into sagemaker support yet but looking at the error message it seems there is an issue with importing tensorflow. Have you tried running a simple tensorflow program without tf hub to see if everything works properly?
I switched to kernel conda-tensorflow and was able to import tensorflow. However, when I tried to import "https://tfhub.dev/google/universal-sentence-encoder/2", I ran into an error of RuntimeError: variable_scope module_3/ was unused but the corresponding name_scope was already taken.
Nvm, I removed tf.enable_eager_execution() cmmd and it works
Closing this based on the previous comment from @rv-ltran.Thanks.
How do I import tensorflow hub into AWS sagemaker? I'm looking to use this model https://tfhub.dev/google/universal-sentence-encoder/1