Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing Keras and Tensorflow on AWS SageMaker

I am trying to download Keras to my notebook instance on AWS SageMaker. The code and the errors or warnings are listed below:

from keras.models import Sequential #Sequential Models
from keras.layers import Dense #Dense Fully Connected Layer Type
from keras.optimizers import SGD #Stochastic Gradient Descent Optimizer
from keras.callbacks import EarlyStopping
from keras.wrappers.scikit_learn import KerasClassifier

Error:

ModuleNotFoundError: No module named 'tensorflow'

Then I tried to download Tensorflow:

!pip install tensorflow

Installation is completed with the following note:

Installing collected packages: wrapt, tensorflow
Found existing installation: wrapt 1.10.11
    Cannot uninstall 'wrapt'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.
    You are using pip version 10.0.1, however version 19.1.1 is available.
    You should consider upgrading via the 'pip install --upgrade pip' command.

Then I try to uninstall wrapt but still having the same issue. Did anyone have the same issue? And is this SageMaker related issue? I also tried to run the below line but didn't change:

from sagemaker.tensorflow import TensorFlow
like image 320
realkes Avatar asked Nov 06 '22 15:11

realkes


1 Answers

Try this:

!pip install tensorflow -t ./

it will install tensorflow in your current directory

like image 188
Debangshu Paul Avatar answered Nov 15 '22 09:11

Debangshu Paul