tensorflow - 在 AWS SageMaker 上安装 Keras 和 Tensorflow

标签 tensorflow keras amazon-sagemaker

我正在尝试将 Keras 下载到我在 AWS SageMaker 上的笔记本实例。下面列出了代码和错误或警告:

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

错误:
ModuleNotFoundError: No module named 'tensorflow'

然后我尝试下载 Tensorflow:
!pip install tensorflow

安装完成,注意以下几点:
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.

然后我尝试卸载 wrapt 但仍然有同样的问题。有没有人有同样的问题?这是 SageMaker 相关的问题吗?我也尝试运行以下行,但没有改变:
from sagemaker.tensorflow import TensorFlow

最佳答案

尝试这个:

!pip install tensorflow -t ./

它将在您的当前目录中安装 tensorflow

关于tensorflow - 在 AWS SageMaker 上安装 Keras 和 Tensorflow,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56917161/

相关文章:

python - 如何从 Keras 模型中获取数据进行可视化?

tensorflow - keras 中的 BatchNormalization 如何工作?

python - tf.data 与 keras.utils.sequence 性能对比

python-3.x - 连接超时——使用sqlalchemy访问AWS usaspending数据

python - 如何在等待响应时增加 AWS Sagemaker 调用超时

tensorflow - 如何随机旋转张量图像

python - 使用 TocoConverter.from_keras_model_file 将 Keras 模型转换为 Tensorflow-Lite 时出现问题

python - 是否可以使用 CNN 对同一对象的图像 block 进行分类,但区域不同?

python - 输出层中不兼容的形状 - Tensorflow

amazon-web-services - 图像识别/分类中的 AWS Sagemaker 多对象检测