Closed stromal closed 3 years ago
@stromal ,
1)Could you please try installing(then importing) the latest versions of tensorflow2.x and tensorflow-hub in a fresh anaconda virtual environment after opening a new notebook in sagemaker(newly created kernel) using the commands below:-
a)!pip install --upgrade tensorflow
b)!pip install --upgrade tensorflow_hub
c)import tensorflow as tf
d)import tensorflow_hub as hub
2)for loading the model through hub, please use:
hub_model = hub.load('https://tfhub.dev/google/magenta/arbitrary-image-stylization-v1-256/2')
GOAL to use a pre trained model from a TensorFlow example project more specifically Tensorflow hub
1.
tensorflow_hub
with the following command:conda install -c conda-forge tensorflow-hub
conda list
OUTPUT: .... tensorflow-hub 0.12.0 pyhca92ed8_0 conda-forge ....import tensorflow_hub as hub
ModuleNotFoundError: No module named 'tensorflow_hub'
Run
conda create -n venv_name
andsource activate venv_name
, wherevenv_name
is the name of your virtual environment.Run
conda install pip
. This will install pip to your venv directory.Find your anaconda directory, and find the actual venv folder. It should be somewhere like
/anaconda/envs/venv_name/
.Install new packages by doing
/anaconda/envs/venv_name/bin/pip install package_name
.OUTPUT
import tensorflow_hub as hub