BentoML Example: Keras Fashion MNIST

BentoML is an open source platform for machine learning model serving and deployment.

This notebook demonstrates how to use BentoML to turn a Keras model into a docker image containing a REST API server serving this model, how to use your ML service built with BentoML as a CLI tool, and how to distribute it a pypi package.

Impression

In [1]:
%reload_ext autoreload
%autoreload 2
%matplotlib inline
In [2]:
#!pip install bentoml
!pip install tensorflow==1.14.0 numpy matplotlib keras
Collecting tensorflow==1.14.0
  Downloading tensorflow-1.14.0-cp37-cp37m-macosx_10_11_x86_64.whl (105.8 MB)
     |████████████████████████████████| 105.8 MB 25.8 MB/s eta 0:00:01
Requirement already satisfied: numpy in /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages (1.16.4)
Requirement already satisfied: matplotlib in /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages (3.1.1)
Requirement already satisfied: keras in /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages (2.2.4)
Requirement already satisfied: six>=1.10.0 in /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages (from tensorflow==1.14.0) (1.14.0)
Requirement already satisfied: google-pasta>=0.1.6 in /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages (from tensorflow==1.14.0) (0.1.8)
Collecting tensorflow-estimator<1.15.0rc0,>=1.14.0rc0
  Using cached tensorflow_estimator-1.14.0-py2.py3-none-any.whl (488 kB)
Requirement already satisfied: grpcio>=1.8.6 in /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages (from tensorflow==1.14.0) (1.22.0)
Requirement already satisfied: astor>=0.6.0 in /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages (from tensorflow==1.14.0) (0.7.1)
Requirement already satisfied: termcolor>=1.1.0 in /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages (from tensorflow==1.14.0) (1.1.0)
Requirement already satisfied: wheel>=0.26 in /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages (from tensorflow==1.14.0) (0.33.6)
Requirement already satisfied: wrapt>=1.11.1 in /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages (from tensorflow==1.14.0) (1.11.1)
Requirement already satisfied: keras-preprocessing>=1.0.5 in /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages (from tensorflow==1.14.0) (1.0.9)
Requirement already satisfied: gast>=0.2.0 in /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages (from tensorflow==1.14.0) (0.2.2)
Requirement already satisfied: protobuf>=3.6.1 in /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages (from tensorflow==1.14.0) (3.7.0)
Collecting tensorboard<1.15.0,>=1.14.0
  Using cached tensorboard-1.14.0-py3-none-any.whl (3.1 MB)
Requirement already satisfied: absl-py>=0.7.0 in /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages (from tensorflow==1.14.0) (0.7.1)
Requirement already satisfied: keras-applications>=1.0.6 in /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages (from tensorflow==1.14.0) (1.0.8)
Requirement already satisfied: cycler>=0.10 in /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages (from matplotlib) (0.10.0)
Requirement already satisfied: kiwisolver>=1.0.1 in /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages (from matplotlib) (1.1.0)
Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages (from matplotlib) (2.4.0)
Requirement already satisfied: python-dateutil>=2.1 in /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages (from matplotlib) (2.8.0)
Requirement already satisfied: h5py in /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages (from keras) (2.9.0)
Requirement already satisfied: pyyaml in /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages (from keras) (5.1)
Requirement already satisfied: scipy>=0.14 in /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages (from keras) (1.2.1)
Requirement already satisfied: setuptools in /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages (from protobuf>=3.6.1->tensorflow==1.14.0) (45.1.0.post20200119)
Requirement already satisfied: markdown>=2.6.8 in /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages (from tensorboard<1.15.0,>=1.14.0->tensorflow==1.14.0) (3.1)
Requirement already satisfied: werkzeug>=0.11.15 in /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages (from tensorboard<1.15.0,>=1.14.0->tensorflow==1.14.0) (0.15.4)
ERROR: fashionmnisttensorflow 20200123104656-1FC32A has requirement bentoml==0.6.0, but you'll have bentoml 0.6.1+4.gd82c2f1 which is incompatible.
Installing collected packages: tensorflow-estimator, tensorboard, tensorflow
  Attempting uninstall: tensorflow-estimator
    Found existing installation: tensorflow-estimator 2.0.1
    Uninstalling tensorflow-estimator-2.0.1:
      Successfully uninstalled tensorflow-estimator-2.0.1
  Attempting uninstall: tensorboard
    Found existing installation: tensorboard 2.0.2
    Uninstalling tensorboard-2.0.2:
      Successfully uninstalled tensorboard-2.0.2
  Attempting uninstall: tensorflow
    Found existing installation: tensorflow 2.0.0
    Uninstalling tensorflow-2.0.0:
      Successfully uninstalled tensorflow-2.0.0
Successfully installed tensorboard-1.14.0 tensorflow-1.14.0 tensorflow-estimator-1.14.0
In [3]:
from __future__ import absolute_import, division, print_function

import numpy as np
import matplotlib.pyplot as plt

import tensorflow as tf
print("Tensorflow Version: %s" % tf.__version__)

import keras
print("Keras Version: %s" % keras.__version__)

import bentoml
print("BentoML Version: %s" % bentoml.__version__)
Tensorflow Version: 1.14.0
Keras Version: 2.2.4
Using TensorFlow backend.
BentoML Version: 0.6.1+4.gd82c2f1

Load Fashion MNIST dataset

In [4]:
fashion_mnist = keras.datasets.fashion_mnist

(train_images, train_labels), (test_images, test_labels) = fashion_mnist.load_data()

Each image is mapped to a single label. Since the class names are not included with the dataset, store them here to use later when plotting the images:

In [5]:
class_names = ['T-shirt/top', 'Trouser', 'Pullover', 'Dress', 'Coat',
               'Sandal', 'Shirt', 'Sneaker', 'Bag', 'Ankle boot']

Preprocess the data

The data must be preprocessed before training the network. If you inspect the first image in the training set, you will see that the pixel values fall in the range of 0 to 255:

In [6]:
plt.figure()
plt.imshow(train_images[0], cmap=plt.cm.binary)
plt.colorbar()
plt.grid(False)
plt.show()

We should scale these values to a range of 0 to 1 before feeding to the neural network model. For this, we divide the values by 255. It's important that the training set and the testing set are preprocessed in the same way:

In [7]:
train_images = train_images / 255.0
test_images = test_images / 255.0

Display the first 25 images from the training set and display the class name below each image. Verify that the data is in the correct format and we're ready to build and train the network.

In [8]:
plt.figure(figsize=(10,10))
for i in range(25):
    plt.subplot(5,5,i+1)
    plt.xticks([])
    plt.yticks([])
    plt.grid(False)
    plt.imshow(train_images[i], cmap=plt.cm.binary)
    plt.xlabel(class_names[train_labels[i]])
plt.show()
In [9]:
# Reshaping the images so that our model can accept it
train_images  = train_images.reshape((60000, 28, 28, 1))
test_images = test_images.reshape((10000, 28, 28, 1))

Build the model

In [10]:
model = keras.Sequential()
# Must define the input shape in the first layer of the neural network
model.add(keras.layers.Conv2D(filters=64, kernel_size=2, padding='same', activation='relu', input_shape=(28,28,1))) 
model.add(keras.layers.MaxPooling2D(pool_size=2))
model.add(keras.layers.Dropout(0.3))
model.add(keras.layers.Conv2D(filters=32, kernel_size=2, padding='same', activation='relu'))
model.add(keras.layers.MaxPooling2D(pool_size=2))
model.add(keras.layers.Dropout(0.3))
model.add(keras.layers.Flatten())
model.add(keras.layers.Dense(256, activation='relu'))
model.add(keras.layers.Dropout(0.5))
model.add(keras.layers.Dense(10, activation='softmax'))
# Take a look at the model summary
model.summary()
WARNING: Logging before flag parsing goes to stderr.
W0206 11:26:13.547391 4362923456 deprecation_wrapper.py:119] From /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py:74: The name tf.get_default_graph is deprecated. Please use tf.compat.v1.get_default_graph instead.

W0206 11:26:13.561075 4362923456 deprecation_wrapper.py:119] From /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py:517: The name tf.placeholder is deprecated. Please use tf.compat.v1.placeholder instead.

W0206 11:26:13.563452 4362923456 deprecation_wrapper.py:119] From /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py:4138: The name tf.random_uniform is deprecated. Please use tf.random.uniform instead.

W0206 11:26:13.577507 4362923456 deprecation_wrapper.py:119] From /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py:3976: The name tf.nn.max_pool is deprecated. Please use tf.nn.max_pool2d instead.

W0206 11:26:13.580346 4362923456 deprecation_wrapper.py:119] From /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py:133: The name tf.placeholder_with_default is deprecated. Please use tf.compat.v1.placeholder_with_default instead.

W0206 11:26:13.588164 4362923456 deprecation.py:506] From /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py:3445: calling dropout (from tensorflow.python.ops.nn_ops) with keep_prob is deprecated and will be removed in a future version.
Instructions for updating:
Please use `rate` instead of `keep_prob`. Rate should be set to `rate = 1 - keep_prob`.
_________________________________________________________________
Layer (type)                 Output Shape              Param #   
=================================================================
conv2d_1 (Conv2D)            (None, 28, 28, 64)        320       
_________________________________________________________________
max_pooling2d_1 (MaxPooling2 (None, 14, 14, 64)        0         
_________________________________________________________________
dropout_1 (Dropout)          (None, 14, 14, 64)        0         
_________________________________________________________________
conv2d_2 (Conv2D)            (None, 14, 14, 32)        8224      
_________________________________________________________________
max_pooling2d_2 (MaxPooling2 (None, 7, 7, 32)          0         
_________________________________________________________________
dropout_2 (Dropout)          (None, 7, 7, 32)          0         
_________________________________________________________________
flatten_1 (Flatten)          (None, 1568)              0         
_________________________________________________________________
dense_1 (Dense)              (None, 256)               401664    
_________________________________________________________________
dropout_3 (Dropout)          (None, 256)               0         
_________________________________________________________________
dense_2 (Dense)              (None, 10)                2570      
=================================================================
Total params: 412,778
Trainable params: 412,778
Non-trainable params: 0
_________________________________________________________________

Compile the model

In [11]:
model.compile(optimizer='adam',
              loss='sparse_categorical_crossentropy',
              metrics=['accuracy'])
W0206 11:26:13.737553 4362923456 deprecation_wrapper.py:119] From /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages/keras/optimizers.py:790: The name tf.train.Optimizer is deprecated. Please use tf.compat.v1.train.Optimizer instead.

W0206 11:26:13.755908 4362923456 deprecation_wrapper.py:119] From /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py:3341: The name tf.log is deprecated. Please use tf.math.log instead.

Train the model

In [12]:
model.fit(train_images, train_labels, batch_size=64, epochs=1)
W0206 11:26:13.888304 4362923456 deprecation.py:323] From /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages/tensorflow/python/ops/math_grad.py:1250: add_dispatch_support.<locals>.wrapper (from tensorflow.python.ops.array_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use tf.where in 2.0, which has the same broadcast rule as np.where
Epoch 1/1
60000/60000 [==============================] - 57s 953us/step - loss: 0.5934 - acc: 0.7827
Out[12]:
<keras.callbacks.History at 0x110753550>

Evaluate model accuracy

In [13]:
test_loss, test_acc = model.evaluate(test_images, test_labels)

print('Test accuracy:', test_acc)
10000/10000 [==============================] - 2s 232us/step
Test accuracy: 0.8571
In [14]:
y_hat = model.predict_classes(test_images)

# Plot a random sample of 10 test images, their predicted labels and ground truth
figure = plt.figure(figsize=(20, 8))
for i, index in enumerate(np.random.choice(test_images.shape[0], size=15, replace=False)):
    ax = figure.add_subplot(3, 5, i + 1, xticks=[], yticks=[])
    # Display each image
    ax.imshow(np.squeeze(test_images[index]))
    predict_index = y_hat[index]
    true_index = test_labels[index]
    # Set the title for each image
    ax.set_title("{} ({})".format(class_names[predict_index], 
                                  class_names[true_index]),
                                  color=("green" if predict_index == true_index else "red"))

Predict on a single image

Let's first see the test image and and its label:

In [15]:
plt.imshow(test_images[0].squeeze(-1), cmap=plt.cm.binary)
plt.show()
print('Class:', class_names[test_labels[0]])
Class: Ankle boot
In [16]:
pred_idx = model.predict_classes(np.expand_dims(test_images[0], 0))[0]
print('Prediction:', class_names[pred_idx])
Prediction: Ankle boot

Define BentoService for model serving

In [24]:
%%writefile keras_fashion_mnist.py

import numpy as np
from PIL import Image
from bentoml import api, artifacts, env, BentoService
from bentoml.artifact import KerasModelArtifact
from bentoml.handlers import ImageHandler

class_names = ['T-shirt/top', 'Trouser', 'Pullover', 'Dress', 'Coat',
               'Sandal', 'Shirt', 'Sneaker', 'Bag', 'Ankle boot']

@env(pip_dependencies=['keras', 'tensorflow==1.14.0', 'Pillow', 'numpy'])
@artifacts([KerasModelArtifact('classifier')])
class KerasFashionMnistService(BentoService):
        
    @api(ImageHandler, pilmode='L')
    def predict(self, img):
        img = Image.fromarray(img).resize((28, 28))
        img /= 255.0
        img = np.array(img.getdata()).reshape((1,28,28,1))
        class_idx = self.artifacts.classifier.predict_classes(img)[0]
        return class_names[class_idx]
Overwriting keras_fashion_mnist.py

Save BentoService to file archive

In [25]:
# 1) import the custom BentoService defined above
from keras_fashion_mnist import KerasFashionMnistService

# 2) `pack` it with required artifacts
mnist_svc = KerasFashionMnistService()
mnist_svc.pack('classifier', model)

# 3) save your BentoSerivce to file archive
saved_path = mnist_svc.save()
[2020-02-06 11:44:30,671] WARNING - BentoML local changes detected - Local BentoML repository including all code changes will be bundled together with the BentoService bundle. When used with docker, the base docker image will be default to same version as last PyPI release at version: 0.6.1. You can also force bentoml to use a specific version for deploying your BentoService bundle, by setting the config 'core/bentoml_deploy_version' to a pinned version or your custom BentoML on github, e.g.:'bentoml_deploy_version = git+https://github.com/{username}/[email protected]{branch}'
[2020-02-06 11:44:30,695] WARNING - BentoML local changes detected - Local BentoML repository including all code changes will be bundled together with the BentoService bundle. When used with docker, the base docker image will be default to same version as last PyPI release at version: 0.6.1. You can also force bentoml to use a specific version for deploying your BentoService bundle, by setting the config 'core/bentoml_deploy_version' to a pinned version or your custom BentoML on github, e.g.:'bentoml_deploy_version = git+https://github.com/{username}/[email protected]{branch}'
[2020-02-06 11:44:56,393] WARNING - BentoML local changes detected - Local BentoML repository including all code changes will be bundled together with the BentoService bundle. When used with docker, the base docker image will be default to same version as last PyPI release at version: 0.6.1. You can also force bentoml to use a specific version for deploying your BentoService bundle, by setting the config 'core/bentoml_deploy_version' to a pinned version or your custom BentoML on github, e.g.:'bentoml_deploy_version = git+https://github.com/{username}/[email protected]{branch}'
running sdist
running egg_info
writing BentoML.egg-info/PKG-INFO
writing dependency_links to BentoML.egg-info/dependency_links.txt
writing entry points to BentoML.egg-info/entry_points.txt
writing requirements to BentoML.egg-info/requires.txt
writing top-level names to BentoML.egg-info/top_level.txt
reading manifest file 'BentoML.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
no previously-included directories found matching 'examples'
no previously-included directories found matching 'tests'
no previously-included directories found matching 'docs'
no previously-included directories found matching 'scripts'
warning: no previously-included files matching '*~' found anywhere in distribution
warning: no previously-included files matching '*.pyo' found anywhere in distribution
warning: no previously-included files matching '.git' found anywhere in distribution
warning: no previously-included files matching '.ipynb_checkpoints' found anywhere in distribution
warning: no previously-included files matching '__pycache__' found anywhere in distribution
writing manifest file 'BentoML.egg-info/SOURCES.txt'
running check
warning: check: missing meta-data: if 'author' supplied, 'author_email' must be supplied too

creating BentoML-0.6.1+4.gd82c2f1
creating BentoML-0.6.1+4.gd82c2f1/BentoML.egg-info
creating BentoML-0.6.1+4.gd82c2f1/bentoml
creating BentoML-0.6.1+4.gd82c2f1/bentoml/artifact
creating BentoML-0.6.1+4.gd82c2f1/bentoml/bundler
creating BentoML-0.6.1+4.gd82c2f1/bentoml/cli
creating BentoML-0.6.1+4.gd82c2f1/bentoml/clipper
creating BentoML-0.6.1+4.gd82c2f1/bentoml/configuration
creating BentoML-0.6.1+4.gd82c2f1/bentoml/deployment
creating BentoML-0.6.1+4.gd82c2f1/bentoml/deployment/aws_lambda
creating BentoML-0.6.1+4.gd82c2f1/bentoml/deployment/sagemaker
creating BentoML-0.6.1+4.gd82c2f1/bentoml/handlers
creating BentoML-0.6.1+4.gd82c2f1/bentoml/migrations
creating BentoML-0.6.1+4.gd82c2f1/bentoml/migrations/versions
creating BentoML-0.6.1+4.gd82c2f1/bentoml/proto
creating BentoML-0.6.1+4.gd82c2f1/bentoml/repository
creating BentoML-0.6.1+4.gd82c2f1/bentoml/server
creating BentoML-0.6.1+4.gd82c2f1/bentoml/server/static
creating BentoML-0.6.1+4.gd82c2f1/bentoml/utils
creating BentoML-0.6.1+4.gd82c2f1/bentoml/utils/validator
creating BentoML-0.6.1+4.gd82c2f1/bentoml/yatai
creating BentoML-0.6.1+4.gd82c2f1/bentoml/yatai/client
copying files to BentoML-0.6.1+4.gd82c2f1...
copying LICENSE -> BentoML-0.6.1+4.gd82c2f1
copying MANIFEST.in -> BentoML-0.6.1+4.gd82c2f1
copying README.md -> BentoML-0.6.1+4.gd82c2f1
copying pyproject.toml -> BentoML-0.6.1+4.gd82c2f1
copying setup.cfg -> BentoML-0.6.1+4.gd82c2f1
copying setup.py -> BentoML-0.6.1+4.gd82c2f1
copying versioneer.py -> BentoML-0.6.1+4.gd82c2f1
copying BentoML.egg-info/PKG-INFO -> BentoML-0.6.1+4.gd82c2f1/BentoML.egg-info
copying BentoML.egg-info/SOURCES.txt -> BentoML-0.6.1+4.gd82c2f1/BentoML.egg-info
copying BentoML.egg-info/dependency_links.txt -> BentoML-0.6.1+4.gd82c2f1/BentoML.egg-info
copying BentoML.egg-info/entry_points.txt -> BentoML-0.6.1+4.gd82c2f1/BentoML.egg-info
copying BentoML.egg-info/requires.txt -> BentoML-0.6.1+4.gd82c2f1/BentoML.egg-info
copying BentoML.egg-info/top_level.txt -> BentoML-0.6.1+4.gd82c2f1/BentoML.egg-info
copying bentoml/__init__.py -> BentoML-0.6.1+4.gd82c2f1/bentoml
copying bentoml/_version.py -> BentoML-0.6.1+4.gd82c2f1/bentoml
copying bentoml/alembic.ini -> BentoML-0.6.1+4.gd82c2f1/bentoml
copying bentoml/db.py -> BentoML-0.6.1+4.gd82c2f1/bentoml
copying bentoml/exceptions.py -> BentoML-0.6.1+4.gd82c2f1/bentoml
copying bentoml/service.py -> BentoML-0.6.1+4.gd82c2f1/bentoml
copying bentoml/service_env.py -> BentoML-0.6.1+4.gd82c2f1/bentoml
copying bentoml/artifact/__init__.py -> BentoML-0.6.1+4.gd82c2f1/bentoml/artifact
copying bentoml/artifact/artifact.py -> BentoML-0.6.1+4.gd82c2f1/bentoml/artifact
copying bentoml/artifact/fastai_model_artifact.py -> BentoML-0.6.1+4.gd82c2f1/bentoml/artifact
copying bentoml/artifact/h2o_model_artifact.py -> BentoML-0.6.1+4.gd82c2f1/bentoml/artifact
copying bentoml/artifact/keras_model_artifact.py -> BentoML-0.6.1+4.gd82c2f1/bentoml/artifact
copying bentoml/artifact/lightgbm_model_artifact.py -> BentoML-0.6.1+4.gd82c2f1/bentoml/artifact
copying bentoml/artifact/pickle_artifact.py -> BentoML-0.6.1+4.gd82c2f1/bentoml/artifact
copying bentoml/artifact/pytorch_model_artifact.py -> BentoML-0.6.1+4.gd82c2f1/bentoml/artifact
copying bentoml/artifact/sklearn_model_artifact.py -> BentoML-0.6.1+4.gd82c2f1/bentoml/artifact
copying bentoml/artifact/text_file_artifact.py -> BentoML-0.6.1+4.gd82c2f1/bentoml/artifact
copying bentoml/artifact/tf_savedmodel_artifact.py -> BentoML-0.6.1+4.gd82c2f1/bentoml/artifact
copying bentoml/artifact/xgboost_model_artifact.py -> BentoML-0.6.1+4.gd82c2f1/bentoml/artifact
copying bentoml/bundler/__init__.py -> BentoML-0.6.1+4.gd82c2f1/bentoml/bundler
copying bentoml/bundler/bundler.py -> BentoML-0.6.1+4.gd82c2f1/bentoml/bundler
copying bentoml/bundler/config.py -> BentoML-0.6.1+4.gd82c2f1/bentoml/bundler
copying bentoml/bundler/loader.py -> BentoML-0.6.1+4.gd82c2f1/bentoml/bundler
copying bentoml/bundler/py_module_utils.py -> BentoML-0.6.1+4.gd82c2f1/bentoml/bundler
copying bentoml/bundler/templates.py -> BentoML-0.6.1+4.gd82c2f1/bentoml/bundler
copying bentoml/bundler/utils.py -> BentoML-0.6.1+4.gd82c2f1/bentoml/bundler
copying bentoml/cli/__init__.py -> BentoML-0.6.1+4.gd82c2f1/bentoml/cli
copying bentoml/cli/aws_lambda.py -> BentoML-0.6.1+4.gd82c2f1/bentoml/cli
copying bentoml/cli/aws_sagemaker.py -> BentoML-0.6.1+4.gd82c2f1/bentoml/cli
copying bentoml/cli/bento.py -> BentoML-0.6.1+4.gd82c2f1/bentoml/cli
copying bentoml/cli/click_utils.py -> BentoML-0.6.1+4.gd82c2f1/bentoml/cli
copying bentoml/cli/config.py -> BentoML-0.6.1+4.gd82c2f1/bentoml/cli
copying bentoml/cli/deployment.py -> BentoML-0.6.1+4.gd82c2f1/bentoml/cli
copying bentoml/cli/utils.py -> BentoML-0.6.1+4.gd82c2f1/bentoml/cli
copying bentoml/clipper/__init__.py -> BentoML-0.6.1+4.gd82c2f1/bentoml/clipper
copying bentoml/configuration/__init__.py -> BentoML-0.6.1+4.gd82c2f1/bentoml/configuration
copying bentoml/configuration/configparser.py -> BentoML-0.6.1+4.gd82c2f1/bentoml/configuration
copying bentoml/configuration/default_bentoml.cfg -> BentoML-0.6.1+4.gd82c2f1/bentoml/configuration
copying bentoml/deployment/__init__.py -> BentoML-0.6.1+4.gd82c2f1/bentoml/deployment
copying bentoml/deployment/operator.py -> BentoML-0.6.1+4.gd82c2f1/bentoml/deployment
copying bentoml/deployment/store.py -> BentoML-0.6.1+4.gd82c2f1/bentoml/deployment
copying bentoml/deployment/utils.py -> BentoML-0.6.1+4.gd82c2f1/bentoml/deployment
copying bentoml/deployment/aws_lambda/__init__.py -> BentoML-0.6.1+4.gd82c2f1/bentoml/deployment/aws_lambda
copying bentoml/deployment/aws_lambda/download_extra_resources.py -> BentoML-0.6.1+4.gd82c2f1/bentoml/deployment/aws_lambda
copying bentoml/deployment/aws_lambda/lambda_app.py -> BentoML-0.6.1+4.gd82c2f1/bentoml/deployment/aws_lambda
copying bentoml/deployment/aws_lambda/utils.py -> BentoML-0.6.1+4.gd82c2f1/bentoml/deployment/aws_lambda
copying bentoml/deployment/sagemaker/__init__.py -> BentoML-0.6.1+4.gd82c2f1/bentoml/deployment/sagemaker
copying bentoml/deployment/sagemaker/sagemaker_nginx.conf -> BentoML-0.6.1+4.gd82c2f1/bentoml/deployment/sagemaker
copying bentoml/deployment/sagemaker/sagemaker_serve.py -> BentoML-0.6.1+4.gd82c2f1/bentoml/deployment/sagemaker
copying bentoml/deployment/sagemaker/sagemaker_wsgi.py -> BentoML-0.6.1+4.gd82c2f1/bentoml/deployment/sagemaker
copying bentoml/handlers/__init__.py -> BentoML-0.6.1+4.gd82c2f1/bentoml/handlers
copying bentoml/handlers/base_handlers.py -> BentoML-0.6.1+4.gd82c2f1/bentoml/handlers
copying bentoml/handlers/clipper_handler.py -> BentoML-0.6.1+4.gd82c2f1/bentoml/handlers
copying bentoml/handlers/dataframe_handler.py -> BentoML-0.6.1+4.gd82c2f1/bentoml/handlers
copying bentoml/handlers/fastai_image_handler.py -> BentoML-0.6.1+4.gd82c2f1/bentoml/handlers
copying bentoml/handlers/image_handler.py -> BentoML-0.6.1+4.gd82c2f1/bentoml/handlers
copying bentoml/handlers/json_handler.py -> BentoML-0.6.1+4.gd82c2f1/bentoml/handlers
copying bentoml/handlers/pytorch_tensor_handler.py -> BentoML-0.6.1+4.gd82c2f1/bentoml/handlers
copying bentoml/handlers/tensorflow_tensor_handler.py -> BentoML-0.6.1+4.gd82c2f1/bentoml/handlers
copying bentoml/handlers/utils.py -> BentoML-0.6.1+4.gd82c2f1/bentoml/handlers
copying bentoml/migrations/README -> BentoML-0.6.1+4.gd82c2f1/bentoml/migrations
copying bentoml/migrations/env.py -> BentoML-0.6.1+4.gd82c2f1/bentoml/migrations
copying bentoml/migrations/script.py.mako -> BentoML-0.6.1+4.gd82c2f1/bentoml/migrations
copying bentoml/migrations/versions/a6b00ae45279_add_last_updated_at_for_deployments.py -> BentoML-0.6.1+4.gd82c2f1/bentoml/migrations/versions
copying bentoml/proto/__init__.py -> BentoML-0.6.1+4.gd82c2f1/bentoml/proto
copying bentoml/proto/deployment_pb2.py -> BentoML-0.6.1+4.gd82c2f1/bentoml/proto
copying bentoml/proto/repository_pb2.py -> BentoML-0.6.1+4.gd82c2f1/bentoml/proto
copying bentoml/proto/status_pb2.py -> BentoML-0.6.1+4.gd82c2f1/bentoml/proto
copying bentoml/proto/yatai_service_pb2.py -> BentoML-0.6.1+4.gd82c2f1/bentoml/proto
copying bentoml/proto/yatai_service_pb2_grpc.py -> BentoML-0.6.1+4.gd82c2f1/bentoml/proto
copying bentoml/repository/__init__.py -> BentoML-0.6.1+4.gd82c2f1/bentoml/repository
copying bentoml/repository/metadata_store.py -> BentoML-0.6.1+4.gd82c2f1/bentoml/repository
copying bentoml/server/__init__.py -> BentoML-0.6.1+4.gd82c2f1/bentoml/server
copying bentoml/server/bento_api_server.py -> BentoML-0.6.1+4.gd82c2f1/bentoml/server
copying bentoml/server/bento_sagemaker_server.py -> BentoML-0.6.1+4.gd82c2f1/bentoml/server
copying bentoml/server/gunicorn_config.py -> BentoML-0.6.1+4.gd82c2f1/bentoml/server
copying bentoml/server/gunicorn_server.py -> BentoML-0.6.1+4.gd82c2f1/bentoml/server
copying bentoml/server/middlewares.py -> BentoML-0.6.1+4.gd82c2f1/bentoml/server
copying bentoml/server/utils.py -> BentoML-0.6.1+4.gd82c2f1/bentoml/server
copying bentoml/server/static/swagger-ui-bundle.js -> BentoML-0.6.1+4.gd82c2f1/bentoml/server/static
copying bentoml/server/static/swagger-ui.css -> BentoML-0.6.1+4.gd82c2f1/bentoml/server/static
copying bentoml/utils/__init__.py -> BentoML-0.6.1+4.gd82c2f1/bentoml/utils
copying bentoml/utils/cloudpickle.py -> BentoML-0.6.1+4.gd82c2f1/bentoml/utils
copying bentoml/utils/hybirdmethod.py -> BentoML-0.6.1+4.gd82c2f1/bentoml/utils
copying bentoml/utils/log.py -> BentoML-0.6.1+4.gd82c2f1/bentoml/utils
copying bentoml/utils/s3.py -> BentoML-0.6.1+4.gd82c2f1/bentoml/utils
copying bentoml/utils/tempdir.py -> BentoML-0.6.1+4.gd82c2f1/bentoml/utils
copying bentoml/utils/usage_stats.py -> BentoML-0.6.1+4.gd82c2f1/bentoml/utils
copying bentoml/utils/validator/__init__.py -> BentoML-0.6.1+4.gd82c2f1/bentoml/utils/validator
copying bentoml/yatai/__init__.py -> BentoML-0.6.1+4.gd82c2f1/bentoml/yatai
copying bentoml/yatai/deployment_utils.py -> BentoML-0.6.1+4.gd82c2f1/bentoml/yatai
copying bentoml/yatai/status.py -> BentoML-0.6.1+4.gd82c2f1/bentoml/yatai
copying bentoml/yatai/yatai_service_impl.py -> BentoML-0.6.1+4.gd82c2f1/bentoml/yatai
copying bentoml/yatai/client/__init__.py -> BentoML-0.6.1+4.gd82c2f1/bentoml/yatai/client
copying bentoml/yatai/client/bento_repository_api.py -> BentoML-0.6.1+4.gd82c2f1/bentoml/yatai/client
copying bentoml/yatai/client/deployment_api.py -> BentoML-0.6.1+4.gd82c2f1/bentoml/yatai/client
Writing BentoML-0.6.1+4.gd82c2f1/setup.cfg
UPDATING BentoML-0.6.1+4.gd82c2f1/bentoml/_version.py
set BentoML-0.6.1+4.gd82c2f1/bentoml/_version.py to '0.6.1+4.gd82c2f1'
Creating tar archive
removing 'BentoML-0.6.1+4.gd82c2f1' (and everything under it)
[2020-02-06 11:44:57,743] INFO - BentoService bundle 'KerasFashionMnistService:20200206114430_94F93D' created at: /private/var/folders/kn/xnc9k74x03567n1mx2tfqnpr0000gn/T/bentoml-temp-swtu2r1a
[2020-02-06 11:44:57,745] WARNING - BentoML local changes detected - Local BentoML repository including all code changes will be bundled together with the BentoService bundle. When used with docker, the base docker image will be default to same version as last PyPI release at version: 0.6.1. You can also force bentoml to use a specific version for deploying your BentoService bundle, by setting the config 'core/bentoml_deploy_version' to a pinned version or your custom BentoML on github, e.g.:'bentoml_deploy_version = git+https://github.com/{username}/[email protected]{branch}'
[2020-02-06 11:44:57,756] WARNING - Saved BentoService bundle version mismatch: loading BentoServie bundle create with BentoML version 0.6.1,  but loading from BentoML version 0.6.1+4.gd82c2f1
[2020-02-06 11:44:57,813] INFO - BentoService bundle 'KerasFashionMnistService:20200206114430_94F93D' created at: /Users/bozhaoyu/bentoml/repository/KerasFashionMnistService/20200206114430_94F93D

Load BentoService from archive

In [26]:
svc = bentoml.load(saved_path)
svc.predict(test_images[0].squeeze(-1))
[2020-02-06 11:45:22,808] WARNING - BentoML local changes detected - Local BentoML repository including all code changes will be bundled together with the BentoService bundle. When used with docker, the base docker image will be default to same version as last PyPI release at version: 0.6.1. You can also force bentoml to use a specific version for deploying your BentoService bundle, by setting the config 'core/bentoml_deploy_version' to a pinned version or your custom BentoML on github, e.g.:'bentoml_deploy_version = git+https://github.com/{username}/[email protected]{branch}'
[2020-02-06 11:45:22,817] WARNING - Saved BentoService bundle version mismatch: loading BentoServie bundle create with BentoML version 0.6.1,  but loading from BentoML version 0.6.1+4.gd82c2f1
[2020-02-06 11:45:22,819] WARNING - Module `keras_fashion_mnist` already loaded, using existing imported module.
[2020-02-06 11:45:24,788] WARNING - BentoML local changes detected - Local BentoML repository including all code changes will be bundled together with the BentoService bundle. When used with docker, the base docker image will be default to same version as last PyPI release at version: 0.6.1. You can also force bentoml to use a specific version for deploying your BentoService bundle, by setting the config 'core/bentoml_deploy_version' to a pinned version or your custom BentoML on github, e.g.:'bentoml_deploy_version = git+https://github.com/{username}/[email protected]{branch}'
Out[26]:
'Ankle boot'

"pip install" a BentoService archive

BentoML user can directly pip install saved BentoML archive with pip install $SAVED_PATH, and use it as a regular python package.

In [19]:
!pip install {saved_path}
Processing /Users/chaoyuyang/bentoml/repository/KerasFashionMnistService/20191014170448_88D4B9
Building wheels for collected packages: KerasFashionMnistService
  Building wheel for KerasFashionMnistService (setup.py) ... done
  Stored in directory: /private/var/folders/ns/vc9qhmqx5dx_9fws7d869lqh0000gn/T/pip-ephem-wheel-cache-3zons_vs/wheels/45/c6/cd/deadc3b6f904fad3a76d71e15d8a469e37def04f583182ceee
Successfully built KerasFashionMnistService
Installing collected packages: KerasFashionMnistService
  Found existing installation: KerasFashionMnistService 20191014170128-BB7310
    Uninstalling KerasFashionMnistService-20191014170128-BB7310:
      Successfully uninstalled KerasFashionMnistService-20191014170128-BB7310
Successfully installed KerasFashionMnistService-20191014170448-88D4B9
In [20]:
# Your bentoML model class name will become packaged name
import KerasFashionMnistService

ms = KerasFashionMnistService.load()
ms.predict(test_images[0].squeeze(-1))
Out[20]:
'Ankle boot'

Use BentoService with BentoML CLI

List BentoService's all version with bentoml get

In [27]:
!bentoml get KerasFashionMnistService
BENTO_SERVICE                                   CREATED_AT        APIS                   ARTIFACTS
KerasFashionMnistService:20200206114430_94F93D  2020-02-06 19:44  predict::ImageHandler  classifier::KerasModelArtifact
KerasFashionMnistService:20200206113040_3B9AE5  2020-02-06 19:31  predict::ImageHandler  classifier::KerasModelArtifact

Use bentoml get <ServiceName>:<ServiceVersion> to get metadata and other details

In [28]:
!bentoml get KerasFashionMnistService:20200206114430_94F93D
{
  "name": "KerasFashionMnistService",
  "version": "20200206114430_94F93D",
  "uri": {
    "type": "LOCAL",
    "uri": "/Users/bozhaoyu/bentoml/repository/KerasFashionMnistService/20200206114430_94F93D"
  },
  "bentoServiceMetadata": {
    "name": "KerasFashionMnistService",
    "version": "20200206114430_94F93D",
    "createdAt": "2020-02-06T19:44:56.394213Z",
    "env": {
      "condaEnv": "name: bentoml-KerasFashionMnistService\nchannels:\n- defaults\ndependencies:\n- python=3.7.3\n- pip\n",
      "pipDependencies": "bentoml==0.6.1\nkeras\ntensorflow==1.14.0\nPillow\nnumpy\nimageio",
      "pythonVersion": "3.7.3"
    },
    "artifacts": [
      {
        "name": "classifier",
        "artifactType": "KerasModelArtifact"
      }
    ],
    "apis": [
      {
        "name": "predict",
        "handlerType": "ImageHandler",
        "docs": "BentoService API"
      }
    ]
  }
}

With bentoml run we can quickly test and validate the prediction result with sample data

In [29]:
!bentoml run KerasFashionMnistService:20200206114430_94F93D predict --input=sample_image.png
[2020-02-06 11:48:04,522] WARNING - BentoML local changes detected - Local BentoML repository including all code changes will be bundled together with the BentoService bundle. When used with docker, the base docker image will be default to same version as last PyPI release at version: 0.6.1. You can also force bentoml to use a specific version for deploying your BentoService bundle, by setting the config 'core/bentoml_deploy_version' to a pinned version or your custom BentoML on github, e.g.:'bentoml_deploy_version = git+https://github.com/{username}/[email protected]{branch}'
[2020-02-06 11:48:04,534] WARNING - Saved BentoService bundle version mismatch: loading BentoServie bundle create with BentoML version 0.6.1,  but loading from BentoML version 0.6.1+4.gd82c2f1
[2020-02-06 11:48:08,233] WARNING - BentoML local changes detected - Local BentoML repository including all code changes will be bundled together with the BentoService bundle. When used with docker, the base docker image will be default to same version as last PyPI release at version: 0.6.1. You can also force bentoml to use a specific version for deploying your BentoService bundle, by setting the config 'core/bentoml_deploy_version' to a pinned version or your custom BentoML on github, e.g.:'bentoml_deploy_version = git+https://github.com/{username}/[email protected]{branch}'
Using TensorFlow backend.
2020-02-06 11:48:08.305813: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
WARNING: Logging before flag parsing goes to stderr.
W0206 11:48:08.306373 4508274112 deprecation_wrapper.py:119] From /Users/bozhaoyu/src/bento/bentoml/artifact/keras_model_artifact.py:114: The name tf.keras.backend.set_session is deprecated. Please use tf.compat.v1.keras.backend.set_session instead.

W0206 11:48:08.308555 4508274112 deprecation_wrapper.py:119] From /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py:517: The name tf.placeholder is deprecated. Please use tf.compat.v1.placeholder instead.

W0206 11:48:08.309844 4508274112 deprecation_wrapper.py:119] From /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py:4138: The name tf.random_uniform is deprecated. Please use tf.random.uniform instead.

W0206 11:48:08.322438 4508274112 deprecation_wrapper.py:119] From /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py:3976: The name tf.nn.max_pool is deprecated. Please use tf.nn.max_pool2d instead.

W0206 11:48:08.323685 4508274112 deprecation_wrapper.py:119] From /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py:131: The name tf.get_default_graph is deprecated. Please use tf.compat.v1.get_default_graph instead.

W0206 11:48:08.323786 4508274112 deprecation_wrapper.py:119] From /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py:133: The name tf.placeholder_with_default is deprecated. Please use tf.compat.v1.placeholder_with_default instead.

W0206 11:48:08.331006 4508274112 deprecation.py:506] From /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py:3445: calling dropout (from tensorflow.python.ops.nn_ops) with keep_prob is deprecated and will be removed in a future version.
Instructions for updating:
Please use `rate` instead of `keep_prob`. Rate should be set to `rate = 1 - keep_prob`.
W0206 11:48:08.427603 4508274112 deprecation_wrapper.py:119] From /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py:174: The name tf.get_default_session is deprecated. Please use tf.compat.v1.get_default_session instead.

W0206 11:48:08.492203 4508274112 deprecation_wrapper.py:119] From /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages/keras/optimizers.py:790: The name tf.train.Optimizer is deprecated. Please use tf.compat.v1.train.Optimizer instead.

W0206 11:48:08.563676 4508274112 deprecation.py:323] From /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages/tensorflow/python/ops/math_grad.py:1250: add_dispatch_support.<locals>.wrapper (from tensorflow.python.ops.array_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use tf.where in 2.0, which has the same broadcast rule as np.where
W0206 11:48:09.051581 4508274112 deprecation_wrapper.py:119] From /Users/bozhaoyu/src/bento/bentoml/artifact/keras_model_artifact.py:100: The name tf.keras.backend.get_session is deprecated. Please use tf.compat.v1.keras.backend.get_session instead.

[2020-02-06 11:48:09,052] WARNING - BentoML local changes detected - Local BentoML repository including all code changes will be bundled together with the BentoService bundle. When used with docker, the base docker image will be default to same version as last PyPI release at version: 0.6.1. You can also force bentoml to use a specific version for deploying your BentoService bundle, by setting the config 'core/bentoml_deploy_version' to a pinned version or your custom BentoML on github, e.g.:'bentoml_deploy_version = git+https://github.com/{username}/[email protected]{branch}'
Ankle boot

Start a local realtime prediction service with bentoml serve

In [31]:
!bentoml serve KerasFashionMnistService:20200206114430_94F93D
[2020-02-06 11:49:37,963] WARNING - BentoML local changes detected - Local BentoML repository including all code changes will be bundled together with the BentoService bundle. When used with docker, the base docker image will be default to same version as last PyPI release at version: 0.6.1. You can also force bentoml to use a specific version for deploying your BentoService bundle, by setting the config 'core/bentoml_deploy_version' to a pinned version or your custom BentoML on github, e.g.:'bentoml_deploy_version = git+https://github.com/{username}/[email protected]{branch}'
[2020-02-06 11:49:37,976] WARNING - Saved BentoService bundle version mismatch: loading BentoServie bundle create with BentoML version 0.6.1,  but loading from BentoML version 0.6.1+4.gd82c2f1
[2020-02-06 11:49:41,662] WARNING - BentoML local changes detected - Local BentoML repository including all code changes will be bundled together with the BentoService bundle. When used with docker, the base docker image will be default to same version as last PyPI release at version: 0.6.1. You can also force bentoml to use a specific version for deploying your BentoService bundle, by setting the config 'core/bentoml_deploy_version' to a pinned version or your custom BentoML on github, e.g.:'bentoml_deploy_version = git+https://github.com/{username}/[email protected]{branch}'
Using TensorFlow backend.
2020-02-06 11:49:41.730857: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
WARNING: Logging before flag parsing goes to stderr.
W0206 11:49:41.731571 4610895296 deprecation_wrapper.py:119] From /Users/bozhaoyu/src/bento/bentoml/artifact/keras_model_artifact.py:114: The name tf.keras.backend.set_session is deprecated. Please use tf.compat.v1.keras.backend.set_session instead.

W0206 11:49:41.739729 4610895296 deprecation_wrapper.py:119] From /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py:517: The name tf.placeholder is deprecated. Please use tf.compat.v1.placeholder instead.

W0206 11:49:41.741406 4610895296 deprecation_wrapper.py:119] From /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py:4138: The name tf.random_uniform is deprecated. Please use tf.random.uniform instead.

W0206 11:49:41.755969 4610895296 deprecation_wrapper.py:119] From /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py:3976: The name tf.nn.max_pool is deprecated. Please use tf.nn.max_pool2d instead.

W0206 11:49:41.757295 4610895296 deprecation_wrapper.py:119] From /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py:131: The name tf.get_default_graph is deprecated. Please use tf.compat.v1.get_default_graph instead.

W0206 11:49:41.757421 4610895296 deprecation_wrapper.py:119] From /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py:133: The name tf.placeholder_with_default is deprecated. Please use tf.compat.v1.placeholder_with_default instead.

W0206 11:49:41.762347 4610895296 deprecation.py:506] From /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py:3445: calling dropout (from tensorflow.python.ops.nn_ops) with keep_prob is deprecated and will be removed in a future version.
Instructions for updating:
Please use `rate` instead of `keep_prob`. Rate should be set to `rate = 1 - keep_prob`.
W0206 11:49:41.904728 4610895296 deprecation_wrapper.py:119] From /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py:174: The name tf.get_default_session is deprecated. Please use tf.compat.v1.get_default_session instead.

W0206 11:49:41.966665 4610895296 deprecation_wrapper.py:119] From /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages/keras/optimizers.py:790: The name tf.train.Optimizer is deprecated. Please use tf.compat.v1.train.Optimizer instead.

W0206 11:49:42.038948 4610895296 deprecation.py:323] From /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages/tensorflow/python/ops/math_grad.py:1250: add_dispatch_support.<locals>.wrapper (from tensorflow.python.ops.array_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use tf.where in 2.0, which has the same broadcast rule as np.where
W0206 11:49:42.650624 4610895296 deprecation_wrapper.py:119] From /Users/bozhaoyu/src/bento/bentoml/artifact/keras_model_artifact.py:100: The name tf.keras.backend.get_session is deprecated. Please use tf.compat.v1.keras.backend.get_session instead.

[2020-02-06 11:49:42,651] WARNING - BentoML local changes detected - Local BentoML repository including all code changes will be bundled together with the BentoService bundle. When used with docker, the base docker image will be default to same version as last PyPI release at version: 0.6.1. You can also force bentoml to use a specific version for deploying your BentoService bundle, by setting the config 'core/bentoml_deploy_version' to a pinned version or your custom BentoML on github, e.g.:'bentoml_deploy_version = git+https://github.com/{username}/[email protected]{branch}'
 * Serving Flask app "KerasFashionMnistService" (lazy loading)
 * Environment: production
   WARNING: This is a development server. Do not use it in a production deployment.
   Use a production WSGI server instead.
 * Debug mode: off
I0206 11:49:42.692592 4610895296 _internal.py:122]  * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
I0206 11:50:06.709295 123145472643072 _internal.py:122] 127.0.0.1 - - [06/Feb/2020 11:50:06] "POST /predict HTTP/1.1" 200 -
^C

Test sending request to API Server from terminal:

curl -X POST "http://127.0.0.1:5000/predict" -F image=@sample_image.png

or:

curl -X POST "http://127.0.0.1:5000/predict" -H "Content-Type: image/png" --data-binary @sample_image.png

Use BentoService as PyPI package

In [33]:
!cd {saved_path} && pip install .
Processing /Users/bozhaoyu/bentoml/repository/KerasFashionMnistService/20200206114430_94F93D
Requirement already satisfied: bentoml==0.6.1 in /Users/bozhaoyu/src/bento (from KerasFashionMnistService===20200206114430-94F93D) (0.6.1+4.gd82c2f1)
Requirement already satisfied: keras in /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages (from KerasFashionMnistService===20200206114430-94F93D) (2.2.4)
Requirement already satisfied: tensorflow==1.14.0 in /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages (from KerasFashionMnistService===20200206114430-94F93D) (1.14.0)
Requirement already satisfied: Pillow in /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages (from KerasFashionMnistService===20200206114430-94F93D) (6.0.0)
Requirement already satisfied: numpy in /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages (from KerasFashionMnistService===20200206114430-94F93D) (1.16.4)
Requirement already satisfied: imageio in /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages (from KerasFashionMnistService===20200206114430-94F93D) (2.5.0)
Requirement already satisfied: ruamel.yaml>=0.15.0 in /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages (from bentoml==0.6.1->KerasFashionMnistService===20200206114430-94F93D) (0.16.5)
Requirement already satisfied: flask in /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages (from bentoml==0.6.1->KerasFashionMnistService===20200206114430-94F93D) (1.0.4)
Requirement already satisfied: gunicorn in /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages (from bentoml==0.6.1->KerasFashionMnistService===20200206114430-94F93D) (19.9.0)
Requirement already satisfied: click>=7.0 in /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages (from bentoml==0.6.1->KerasFashionMnistService===20200206114430-94F93D) (7.0)
Requirement already satisfied: pandas in /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages (from bentoml==0.6.1->KerasFashionMnistService===20200206114430-94F93D) (0.24.2)
Requirement already satisfied: prometheus_client in /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages (from bentoml==0.6.1->KerasFashionMnistService===20200206114430-94F93D) (0.7.1)
Requirement already satisfied: python-json-logger in /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages (from bentoml==0.6.1->KerasFashionMnistService===20200206114430-94F93D) (0.1.11)
Requirement already satisfied: boto3 in /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages (from bentoml==0.6.1->KerasFashionMnistService===20200206114430-94F93D) (1.10.42)
Requirement already satisfied: requests in /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages (from bentoml==0.6.1->KerasFashionMnistService===20200206114430-94F93D) (2.22.0)
Requirement already satisfied: packaging in /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages (from bentoml==0.6.1->KerasFashionMnistService===20200206114430-94F93D) (19.0)
Requirement already satisfied: docker in /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages (from bentoml==0.6.1->KerasFashionMnistService===20200206114430-94F93D) (4.1.0)
Requirement already satisfied: configparser in /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages (from bentoml==0.6.1->KerasFashionMnistService===20200206114430-94F93D) (3.7.4)
Requirement already satisfied: sqlalchemy>=1.3.0 in /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages (from bentoml==0.6.1->KerasFashionMnistService===20200206114430-94F93D) (1.3.6)
Requirement already satisfied: protobuf>=3.6.0 in /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages (from bentoml==0.6.1->KerasFashionMnistService===20200206114430-94F93D) (3.7.0)
Requirement already satisfied: grpcio in /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages (from bentoml==0.6.1->KerasFashionMnistService===20200206114430-94F93D) (1.22.0)
Requirement already satisfied: cerberus in /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages (from bentoml==0.6.1->KerasFashionMnistService===20200206114430-94F93D) (1.3.1)
Requirement already satisfied: tabulate in /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages (from bentoml==0.6.1->KerasFashionMnistService===20200206114430-94F93D) (0.8.3)
Requirement already satisfied: humanfriendly in /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages (from bentoml==0.6.1->KerasFashionMnistService===20200206114430-94F93D) (4.18)
Requirement already satisfied: alembic in /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages (from bentoml==0.6.1->KerasFashionMnistService===20200206114430-94F93D) (1.2.1)
Requirement already satisfied: python-dateutil<2.8.1,>=2.1 in /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages (from bentoml==0.6.1->KerasFashionMnistService===20200206114430-94F93D) (2.8.0)
Requirement already satisfied: six>=1.9.0 in /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages (from keras->KerasFashionMnistService===20200206114430-94F93D) (1.14.0)
Requirement already satisfied: h5py in /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages (from keras->KerasFashionMnistService===20200206114430-94F93D) (2.9.0)
Requirement already satisfied: keras-applications>=1.0.6 in /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages (from keras->KerasFashionMnistService===20200206114430-94F93D) (1.0.8)
Requirement already satisfied: keras-preprocessing>=1.0.5 in /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages (from keras->KerasFashionMnistService===20200206114430-94F93D) (1.0.9)
Requirement already satisfied: scipy>=0.14 in /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages (from keras->KerasFashionMnistService===20200206114430-94F93D) (1.2.1)
Requirement already satisfied: pyyaml in /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages (from keras->KerasFashionMnistService===20200206114430-94F93D) (5.1)
Requirement already satisfied: termcolor>=1.1.0 in /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages (from tensorflow==1.14.0->KerasFashionMnistService===20200206114430-94F93D) (1.1.0)
Requirement already satisfied: astor>=0.6.0 in /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages (from tensorflow==1.14.0->KerasFashionMnistService===20200206114430-94F93D) (0.7.1)
Requirement already satisfied: tensorflow-estimator<1.15.0rc0,>=1.14.0rc0 in /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages (from tensorflow==1.14.0->KerasFashionMnistService===20200206114430-94F93D) (1.14.0)
Requirement already satisfied: gast>=0.2.0 in /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages (from tensorflow==1.14.0->KerasFashionMnistService===20200206114430-94F93D) (0.2.2)
Requirement already satisfied: wheel>=0.26 in /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages (from tensorflow==1.14.0->KerasFashionMnistService===20200206114430-94F93D) (0.33.6)
Requirement already satisfied: tensorboard<1.15.0,>=1.14.0 in /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages (from tensorflow==1.14.0->KerasFashionMnistService===20200206114430-94F93D) (1.14.0)
Requirement already satisfied: absl-py>=0.7.0 in /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages (from tensorflow==1.14.0->KerasFashionMnistService===20200206114430-94F93D) (0.7.1)
Requirement already satisfied: wrapt>=1.11.1 in /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages (from tensorflow==1.14.0->KerasFashionMnistService===20200206114430-94F93D) (1.11.1)
Requirement already satisfied: google-pasta>=0.1.6 in /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages (from tensorflow==1.14.0->KerasFashionMnistService===20200206114430-94F93D) (0.1.8)
Requirement already satisfied: ruamel.yaml.clib>=0.1.2; platform_python_implementation == "CPython" and python_version < "3.8" in /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages (from ruamel.yaml>=0.15.0->bentoml==0.6.1->KerasFashionMnistService===20200206114430-94F93D) (0.2.0)
Requirement already satisfied: Jinja2>=2.10 in /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages (from flask->bentoml==0.6.1->KerasFashionMnistService===20200206114430-94F93D) (2.10.1)
Requirement already satisfied: Werkzeug>=0.14 in /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages (from flask->bentoml==0.6.1->KerasFashionMnistService===20200206114430-94F93D) (0.15.4)
Requirement already satisfied: itsdangerous>=0.24 in /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages (from flask->bentoml==0.6.1->KerasFashionMnistService===20200206114430-94F93D) (1.1.0)
Requirement already satisfied: pytz>=2011k in /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages (from pandas->bentoml==0.6.1->KerasFashionMnistService===20200206114430-94F93D) (2019.1)
Requirement already satisfied: s3transfer<0.3.0,>=0.2.0 in /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages (from boto3->bentoml==0.6.1->KerasFashionMnistService===20200206114430-94F93D) (0.2.1)
Requirement already satisfied: jmespath<1.0.0,>=0.7.1 in /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages (from boto3->bentoml==0.6.1->KerasFashionMnistService===20200206114430-94F93D) (0.9.4)
Requirement already satisfied: botocore<1.14.0,>=1.13.42 in /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages (from boto3->bentoml==0.6.1->KerasFashionMnistService===20200206114430-94F93D) (1.13.42)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages (from requests->bentoml==0.6.1->KerasFashionMnistService===20200206114430-94F93D) (2019.11.28)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages (from requests->bentoml==0.6.1->KerasFashionMnistService===20200206114430-94F93D) (3.0.4)
Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages (from requests->bentoml==0.6.1->KerasFashionMnistService===20200206114430-94F93D) (1.24.1)
Requirement already satisfied: idna<2.9,>=2.5 in /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages (from requests->bentoml==0.6.1->KerasFashionMnistService===20200206114430-94F93D) (2.8)
Requirement already satisfied: pyparsing>=2.0.2 in /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages (from packaging->bentoml==0.6.1->KerasFashionMnistService===20200206114430-94F93D) (2.4.0)
Requirement already satisfied: websocket-client>=0.32.0 in /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages (from docker->bentoml==0.6.1->KerasFashionMnistService===20200206114430-94F93D) (0.57.0)
Requirement already satisfied: setuptools in /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages (from protobuf>=3.6.0->bentoml==0.6.1->KerasFashionMnistService===20200206114430-94F93D) (45.1.0.post20200119)
Requirement already satisfied: Mako in /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages (from alembic->bentoml==0.6.1->KerasFashionMnistService===20200206114430-94F93D) (1.1.0)
Requirement already satisfied: python-editor>=0.3 in /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages (from alembic->bentoml==0.6.1->KerasFashionMnistService===20200206114430-94F93D) (1.0.4)
Requirement already satisfied: markdown>=2.6.8 in /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages (from tensorboard<1.15.0,>=1.14.0->tensorflow==1.14.0->KerasFashionMnistService===20200206114430-94F93D) (3.1)
Requirement already satisfied: MarkupSafe>=0.23 in /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages (from Jinja2>=2.10->flask->bentoml==0.6.1->KerasFashionMnistService===20200206114430-94F93D) (1.1.1)
Requirement already satisfied: docutils<0.16,>=0.10 in /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages (from botocore<1.14.0,>=1.13.42->boto3->bentoml==0.6.1->KerasFashionMnistService===20200206114430-94F93D) (0.15.2)
Building wheels for collected packages: KerasFashionMnistService
  Building wheel for KerasFashionMnistService (setup.py) ... done
  Created wheel for KerasFashionMnistService: filename=KerasFashionMnistService-20200206114430_94F93D-py3-none-any.whl size=4674994 sha256=9223b063c8feebb38338bc4504ca5d05402a48007f6afa692a478b7fd1c52141
  Stored in directory: /private/var/folders/kn/xnc9k74x03567n1mx2tfqnpr0000gn/T/pip-ephem-wheel-cache-x6ygrc7k/wheels/9f/f5/dc/53ac3e76296c27213f9f8a916cf5b81124f90e49978eee694b
Successfully built KerasFashionMnistService
Installing collected packages: KerasFashionMnistService
Successfully installed KerasFashionMnistService-20200206114430-94F93D
In [35]:
!KerasFashionMnistService run predict --input=sample_image.png
[2020-02-06 14:23:57,140] WARNING - BentoML local changes detected - Local BentoML repository including all code changes will be bundled together with the BentoService bundle. When used with docker, the base docker image will be default to same version as last PyPI release at version: 0.6.1. You can also force bentoml to use a specific version for deploying your BentoService bundle, by setting the config 'core/bentoml_deploy_version' to a pinned version or your custom BentoML on github, e.g.:'bentoml_deploy_version = git+https://github.com/{username}/[email protected]{branch}'
[2020-02-06 14:23:57,158] WARNING - Saved BentoService bundle version mismatch: loading BentoServie bundle create with BentoML version 0.6.1,  but loading from BentoML version 0.6.1+4.gd82c2f1
[2020-02-06 14:23:57,160] WARNING - BentoML local changes detected - Local BentoML repository including all code changes will be bundled together with the BentoService bundle. When used with docker, the base docker image will be default to same version as last PyPI release at version: 0.6.1. You can also force bentoml to use a specific version for deploying your BentoService bundle, by setting the config 'core/bentoml_deploy_version' to a pinned version or your custom BentoML on github, e.g.:'bentoml_deploy_version = git+https://github.com/{username}/[email protected]{branch}'
Using TensorFlow backend.
2020-02-06 14:23:57.241009: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
WARNING: Logging before flag parsing goes to stderr.
W0206 14:23:57.241580 4688264640 deprecation_wrapper.py:119] From /Users/bozhaoyu/src/bento/bentoml/artifact/keras_model_artifact.py:114: The name tf.keras.backend.set_session is deprecated. Please use tf.compat.v1.keras.backend.set_session instead.

W0206 14:23:57.245157 4688264640 deprecation_wrapper.py:119] From /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py:517: The name tf.placeholder is deprecated. Please use tf.compat.v1.placeholder instead.

W0206 14:23:57.246453 4688264640 deprecation_wrapper.py:119] From /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py:4138: The name tf.random_uniform is deprecated. Please use tf.random.uniform instead.

W0206 14:23:57.255999 4688264640 deprecation_wrapper.py:119] From /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py:3976: The name tf.nn.max_pool is deprecated. Please use tf.nn.max_pool2d instead.

W0206 14:23:57.257534 4688264640 deprecation_wrapper.py:119] From /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py:131: The name tf.get_default_graph is deprecated. Please use tf.compat.v1.get_default_graph instead.

W0206 14:23:57.257631 4688264640 deprecation_wrapper.py:119] From /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py:133: The name tf.placeholder_with_default is deprecated. Please use tf.compat.v1.placeholder_with_default instead.

W0206 14:23:57.262071 4688264640 deprecation.py:506] From /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py:3445: calling dropout (from tensorflow.python.ops.nn_ops) with keep_prob is deprecated and will be removed in a future version.
Instructions for updating:
Please use `rate` instead of `keep_prob`. Rate should be set to `rate = 1 - keep_prob`.
W0206 14:23:57.365312 4688264640 deprecation_wrapper.py:119] From /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py:174: The name tf.get_default_session is deprecated. Please use tf.compat.v1.get_default_session instead.

W0206 14:23:57.427512 4688264640 deprecation_wrapper.py:119] From /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages/keras/optimizers.py:790: The name tf.train.Optimizer is deprecated. Please use tf.compat.v1.train.Optimizer instead.

W0206 14:23:57.498518 4688264640 deprecation.py:323] From /usr/local/anaconda3/envs/dev-py3/lib/python3.7/site-packages/tensorflow/python/ops/math_grad.py:1250: add_dispatch_support.<locals>.wrapper (from tensorflow.python.ops.array_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use tf.where in 2.0, which has the same broadcast rule as np.where
W0206 14:23:58.051529 4688264640 deprecation_wrapper.py:119] From /Users/bozhaoyu/src/bento/bentoml/artifact/keras_model_artifact.py:100: The name tf.keras.backend.get_session is deprecated. Please use tf.compat.v1.keras.backend.get_session instead.

[2020-02-06 14:23:58,052] WARNING - BentoML local changes detected - Local BentoML repository including all code changes will be bundled together with the BentoService bundle. When used with docker, the base docker image will be default to same version as last PyPI release at version: 0.6.1. You can also force bentoml to use a specific version for deploying your BentoService bundle, by setting the config 'core/bentoml_deploy_version' to a pinned version or your custom BentoML on github, e.g.:'bentoml_deploy_version = git+https://github.com/{username}/[email protected]{branch}'
Ankle boot

Containerize REST API server with Docker

** Make sure you have docker installed, note that it is not available when running in Google Colaboratory

In [36]:
!cd {saved_path} && docker build -t keras-fashion-mnist .
Sending build context to Docker daemon  6.004MB
Step 1/12 : FROM continuumio/miniconda3:4.7.12
4.7.12: Pulling from continuumio/miniconda3
Digest: sha256:6c979670684d970f8ba934bf9b7bf42e77c30a22eb96af1f30a039b484719159
Status: Downloaded newer image for continuumio/miniconda3:4.7.12
 ---> 406f2b43ea59
Step 2/12 : ENTRYPOINT [ "/bin/bash", "-c" ]
 ---> Using cache
 ---> 28172be83c07
Step 3/12 : EXPOSE 5000
 ---> Using cache
 ---> 840844d191d4
Step 4/12 : RUN set -x      && apt-get update      && apt-get install --no-install-recommends --no-install-suggests -y libpq-dev build-essential      && rm -rf /var/lib/apt/lists/*
 ---> Using cache
 ---> 243c05e712f3
Step 5/12 : RUN conda install pip numpy scipy       && pip install gunicorn
 ---> Using cache
 ---> 8fab95ab34fc
Step 6/12 : COPY . /bento
 ---> a000f9f4d4da
Step 7/12 : WORKDIR /bento
 ---> Running in 7b55d887cbfe
Removing intermediate container 7b55d887cbfe
 ---> 626eaec4dbed
Step 8/12 : RUN if [ -f /bento/setup.sh ]; then /bin/bash -c /bento/setup.sh; fi
 ---> Running in 4e77436a84ec
Removing intermediate container 4e77436a84ec
 ---> cda5c2f2714f
Step 9/12 : RUN conda env update -n base -f /bento/environment.yml
 ---> Running in 02cc47071336
Collecting package metadata (repodata.json): ...working... done
Solving environment: ...working... done

Downloading and Extracting Packages
ca-certificates-2020 | 125 KB    | ########## | 100% 
python-3.7.3         | 32.1 MB   | ########## | 100% 
pip-20.0.2           | 1.7 MB    | ########## | 100% 
Preparing transaction: ...working... done
Verifying transaction: ...working... done
Executing transaction: ...working... done


==> WARNING: A newer version of conda exists. <==
  current version: 4.8.1
  latest version: 4.8.2

Please update conda by running

    $ conda update -n base -c defaults conda


#
# To activate this environment, use
#
#     $ conda activate base
#
# To deactivate an active environment, use
#
#     $ conda deactivate

Removing intermediate container 02cc47071336
 ---> 84b1f11625ce
Step 10/12 : RUN pip install -r /bento/requirements.txt
 ---> Running in 96865990f13b
Collecting bentoml==0.6.1
  Downloading BentoML-0.6.1-py3-none-any.whl (553 kB)
Collecting keras
  Downloading Keras-2.3.1-py2.py3-none-any.whl (377 kB)
Collecting tensorflow==1.14.0
  Downloading tensorflow-1.14.0-cp37-cp37m-manylinux1_x86_64.whl (109.3 MB)
Collecting Pillow
  Downloading Pillow-7.0.0-cp37-cp37m-manylinux1_x86_64.whl (2.1 MB)
Requirement already satisfied: numpy in /opt/conda/lib/python3.7/site-packages (from -r /bento/requirements.txt (line 5)) (1.18.1)
Collecting imageio
  Downloading imageio-2.6.1-py3-none-any.whl (3.3 MB)
Collecting docker
  Downloading docker-4.2.0-py2.py3-none-any.whl (143 kB)
Collecting click>=7.0
  Downloading Click-7.0-py2.py3-none-any.whl (81 kB)
Collecting prometheus-client
  Downloading prometheus_client-0.7.1.tar.gz (38 kB)
Collecting grpcio
  Downloading grpcio-1.26.0-cp37-cp37m-manylinux2010_x86_64.whl (2.4 MB)
Collecting humanfriendly
  Downloading humanfriendly-5.0-py2.py3-none-any.whl (74 kB)
Requirement already satisfied: requests in /opt/conda/lib/python3.7/site-packages (from bentoml==0.6.1->-r /bento/requirements.txt (line 1)) (2.22.0)
Collecting tabulate
  Downloading tabulate-0.8.6.tar.gz (45 kB)
Collecting configparser
  Downloading configparser-4.0.2-py2.py3-none-any.whl (22 kB)
Collecting python-dateutil<2.8.1,>=2.1
  Downloading python_dateutil-2.8.0-py2.py3-none-any.whl (226 kB)
Collecting boto3
  Downloading boto3-1.11.12-py2.py3-none-any.whl (128 kB)
Collecting protobuf>=3.6.0
  Downloading protobuf-3.11.3-cp37-cp37m-manylinux1_x86_64.whl (1.3 MB)
Collecting cerberus
  Downloading Cerberus-1.3.2.tar.gz (52 kB)
Collecting ruamel.yaml>=0.15.0
  Downloading ruamel.yaml-0.16.7-py2.py3-none-any.whl (123 kB)
Collecting flask
  Downloading Flask-1.1.1-py2.py3-none-any.whl (94 kB)
Collecting python-json-logger
  Downloading python-json-logger-0.1.11.tar.gz (6.0 kB)
Collecting sqlalchemy>=1.3.0
  Downloading SQLAlchemy-1.3.13.tar.gz (6.0 MB)
Collecting packaging
  Downloading packaging-20.1-py2.py3-none-any.whl (36 kB)
Collecting alembic
  Downloading alembic-1.4.0.tar.gz (1.1 MB)
Requirement already satisfied: gunicorn in /opt/conda/lib/python3.7/site-packages (from bentoml==0.6.1->-r /bento/requirements.txt (line 1)) (20.0.4)
Collecting pandas
  Downloading pandas-1.0.1-cp37-cp37m-manylinux1_x86_64.whl (10.1 MB)
Collecting keras-preprocessing>=1.0.5
  Downloading Keras_Preprocessing-1.1.0-py2.py3-none-any.whl (41 kB)
Requirement already satisfied: scipy>=0.14 in /opt/conda/lib/python3.7/site-packages (from keras->-r /bento/requirements.txt (line 2)) (1.3.2)
Collecting keras-applications>=1.0.6
  Downloading Keras_Applications-1.0.8-py3-none-any.whl (50 kB)
Collecting h5py
  Downloading h5py-2.10.0-cp37-cp37m-manylinux1_x86_64.whl (2.9 MB)
Requirement already satisfied: six>=1.9.0 in /opt/conda/lib/python3.7/site-packages (from keras->-r /bento/requirements.txt (line 2)) (1.12.0)
Collecting pyyaml
  Downloading PyYAML-5.3.tar.gz (268 kB)
Collecting astor>=0.6.0
  Downloading astor-0.8.1-py2.py3-none-any.whl (27 kB)
Collecting tensorflow-estimator<1.15.0rc0,>=1.14.0rc0
  Downloading tensorflow_estimator-1.14.0-py2.py3-none-any.whl (488 kB)
Collecting google-pasta>=0.1.6
  Downloading google_pasta-0.1.8-py3-none-any.whl (57 kB)
Collecting termcolor>=1.1.0
  Downloading termcolor-1.1.0.tar.gz (3.9 kB)
Collecting wrapt>=1.11.1
  Downloading wrapt-1.11.2.tar.gz (27 kB)
Requirement already satisfied: wheel>=0.26 in /opt/conda/lib/python3.7/site-packages (from tensorflow==1.14.0->-r /bento/requirements.txt (line 3)) (0.33.6)
Collecting absl-py>=0.7.0
  Downloading absl-py-0.9.0.tar.gz (104 kB)
Collecting gast>=0.2.0
  Downloading gast-0.3.3-py2.py3-none-any.whl (9.7 kB)
Collecting tensorboard<1.15.0,>=1.14.0
  Downloading tensorboard-1.14.0-py3-none-any.whl (3.1 MB)
Collecting websocket-client>=0.32.0
  Downloading websocket_client-0.57.0-py2.py3-none-any.whl (200 kB)
Requirement already satisfied: idna<2.9,>=2.5 in /opt/conda/lib/python3.7/site-packages (from requests->bentoml==0.6.1->-r /bento/requirements.txt (line 1)) (2.8)
Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /opt/conda/lib/python3.7/site-packages (from requests->bentoml==0.6.1->-r /bento/requirements.txt (line 1)) (1.24.2)
Requirement already satisfied: certifi>=2017.4.17 in /opt/conda/lib/python3.7/site-packages (from requests->bentoml==0.6.1->-r /bento/requirements.txt (line 1)) (2019.11.28)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /opt/conda/lib/python3.7/site-packages (from requests->bentoml==0.6.1->-r /bento/requirements.txt (line 1)) (3.0.4)
Collecting jmespath<1.0.0,>=0.7.1
  Downloading jmespath-0.9.4-py2.py3-none-any.whl (24 kB)
Collecting s3transfer<0.4.0,>=0.3.0
  Downloading s3transfer-0.3.3-py2.py3-none-any.whl (69 kB)
Collecting botocore<1.15.0,>=1.14.12
  Downloading botocore-1.14.12-py2.py3-none-any.whl (5.9 MB)
Requirement already satisfied: setuptools in /opt/conda/lib/python3.7/site-packages (from protobuf>=3.6.0->bentoml==0.6.1->-r /bento/requirements.txt (line 1)) (41.4.0)
Collecting ruamel.yaml.clib>=0.1.2; platform_python_implementation == "CPython" and python_version < "3.8"
  Downloading ruamel.yaml.clib-0.2.0-cp37-cp37m-manylinux1_x86_64.whl (547 kB)
Collecting itsdangerous>=0.24
  Downloading itsdangerous-1.1.0-py2.py3-none-any.whl (16 kB)
Collecting Werkzeug>=0.15
  Downloading Werkzeug-1.0.0-py2.py3-none-any.whl (298 kB)
Collecting Jinja2>=2.10.1
  Downloading Jinja2-2.11.1-py2.py3-none-any.whl (126 kB)
Collecting pyparsing>=2.0.2
  Downloading pyparsing-2.4.6-py2.py3-none-any.whl (67 kB)
Collecting Mako
  Downloading Mako-1.1.1.tar.gz (468 kB)
Collecting python-editor>=0.3
  Downloading python_editor-1.0.4-py3-none-any.whl (4.9 kB)
Collecting pytz>=2017.2
  Downloading pytz-2019.3-py2.py3-none-any.whl (509 kB)
Collecting markdown>=2.6.8
  Downloading Markdown-3.1.1-py2.py3-none-any.whl (87 kB)
Collecting docutils<0.16,>=0.10
  Downloading docutils-0.15.2-py3-none-any.whl (547 kB)
Collecting MarkupSafe>=0.23
  Downloading MarkupSafe-1.1.1-cp37-cp37m-manylinux1_x86_64.whl (27 kB)
Building wheels for collected packages: prometheus-client, tabulate, cerberus, python-json-logger, sqlalchemy, alembic, pyyaml, termcolor, wrapt, absl-py, Mako
  Building wheel for prometheus-client (setup.py): started
  Building wheel for prometheus-client (setup.py): finished with status 'done'
  Created wheel for prometheus-client: filename=prometheus_client-0.7.1-py3-none-any.whl size=41402 sha256=a66a643f86a2a049f365492eecd3159e2c054ca70f4b55c3d189c34c35180e0a
  Stored in directory: /root/.cache/pip/wheels/30/0c/26/59ba285bf65dc79d195e9b25e2ddde4c61070422729b0cd914
  Building wheel for tabulate (setup.py): started
  Building wheel for tabulate (setup.py): finished with status 'done'
  Created wheel for tabulate: filename=tabulate-0.8.6-py3-none-any.whl size=23273 sha256=2a1acc37390db4543ca6c8a62d4c148d6f3484ee6e759f473edb3e1f1db648ad
  Stored in directory: /root/.cache/pip/wheels/09/b6/7e/08b4ee715a1239453e89a59081f0ac369a9036f232e013ecd8
  Building wheel for cerberus (setup.py): started
  Building wheel for cerberus (setup.py): finished with status 'done'
  Created wheel for cerberus: filename=Cerberus-1.3.2-py3-none-any.whl size=54335 sha256=22904cefd97f314f6392e347a9b65fbcfdfd619dcd701f5b0552e841d5beff75
  Stored in directory: /root/.cache/pip/wheels/17/3a/0d/e2fc48cf85cb858f5e65f1baa36180ebb5dce6397c35c4cfcb
  Building wheel for python-json-logger (setup.py): started
  Building wheel for python-json-logger (setup.py): finished with status 'done'
  Created wheel for python-json-logger: filename=python_json_logger-0.1.11-py2.py3-none-any.whl size=5076 sha256=1ebb9dadc6b4cca5dcf918e1b54b86e747d7c180793a7b24a76e7c6108526404
  Stored in directory: /root/.cache/pip/wheels/fa/7f/fd/92ccdbb9d1a65486406e0363d2ba5b4ce52f400a915f602ecb
  Building wheel for sqlalchemy (setup.py): started
  Building wheel for sqlalchemy (setup.py): finished with status 'done'
  Created wheel for sqlalchemy: filename=SQLAlchemy-1.3.13-cp37-cp37m-linux_x86_64.whl size=1223709 sha256=1663f722b3550252a6e056e4f365b58affd67e8f33a18bd553ee38ccd4181101
  Stored in directory: /root/.cache/pip/wheels/b9/ba/77/163f10f14bd489351530603e750c195b0ceceed2f3be2b32f1
  Building wheel for alembic (setup.py): started
  Building wheel for alembic (setup.py): finished with status 'done'
  Created wheel for alembic: filename=alembic-1.4.0-py2.py3-none-any.whl size=157563 sha256=7d961197b784c195f1ff8f3058d8cbaf11efd3b904db9c7abddfcc4095f58d2c
  Stored in directory: /root/.cache/pip/wheels/33/a9/f9/a53f885636269db5b76cf7afa3a1ab86d9d2fe96610d09274e
  Building wheel for pyyaml (setup.py): started
  Building wheel for pyyaml (setup.py): finished with status 'done'
  Created wheel for pyyaml: filename=PyYAML-5.3-cp37-cp37m-linux_x86_64.whl size=44228 sha256=fa9482fc44a804ca0cc33503baf733861e5d3e672130634e85a3247f776f59e7
  Stored in directory: /root/.cache/pip/wheels/8a/55/a4/c0a81d27c33462cfdcb904db018f5550197e88b2b6b85beed2
  Building wheel for termcolor (setup.py): started
  Building wheel for termcolor (setup.py): finished with status 'done'
  Created wheel for termcolor: filename=termcolor-1.1.0-py3-none-any.whl size=4830 sha256=7ab7fd8337efbe4b153eb7c1f84cc5b7dbbc8becc44ff9194d2eeba86231101c
  Stored in directory: /root/.cache/pip/wheels/3f/e3/ec/8a8336ff196023622fbcb36de0c5a5c218cbb24111d1d4c7f2
  Building wheel for wrapt (setup.py): started
  Building wheel for wrapt (setup.py): finished with status 'done'
  Created wheel for wrapt: filename=wrapt-1.11.2-cp37-cp37m-linux_x86_64.whl size=76121 sha256=a03fc572d9405c11cfc16067eee81e5d27eedda3ccbcbaeb9b160c260a281554
  Stored in directory: /root/.cache/pip/wheels/23/5f/62/304b411f20be41821465a82bc98baabc5e68c3cdd1eb99db71
  Building wheel for absl-py (setup.py): started
  Building wheel for absl-py (setup.py): finished with status 'done'
  Created wheel for absl-py: filename=absl_py-0.9.0-py3-none-any.whl size=121931 sha256=717b1debab5dd9c1af9c2ef042d2032c7941c6c7097fa3f0427acba01268762a
  Stored in directory: /root/.cache/pip/wheels/cc/af/1a/498a24d0730ef484019e007bb9e8cef3ac00311a672c049a3e
  Building wheel for Mako (setup.py): started
  Building wheel for Mako (setup.py): finished with status 'done'
  Created wheel for Mako: filename=Mako-1.1.1-py3-none-any.whl size=75409 sha256=e8429236b9343b6ffd11c547e48d538a2c0098c0df45a2bcb0da29100b0ff060
  Stored in directory: /root/.cache/pip/wheels/11/fe/fa/3693b62cf5ec2b2784b6496734f0ee3e2321eb66d66607e5f9
Successfully built prometheus-client tabulate cerberus python-json-logger sqlalchemy alembic pyyaml termcolor wrapt absl-py Mako
Installing collected packages: websocket-client, docker, click, prometheus-client, grpcio, humanfriendly, tabulate, configparser, python-dateutil, jmespath, docutils, botocore, s3transfer, boto3, protobuf, cerberus, ruamel.yaml.clib, ruamel.yaml, itsdangerous, Werkzeug, MarkupSafe, Jinja2, flask, python-json-logger, sqlalchemy, pyparsing, packaging, Mako, python-editor, alembic, pytz, pandas, bentoml, keras-preprocessing, h5py, keras-applications, pyyaml, keras, astor, tensorflow-estimator, google-pasta, termcolor, wrapt, absl-py, gast, markdown, tensorboard, tensorflow, Pillow, imageio
Successfully installed Jinja2-2.11.1 Mako-1.1.1 MarkupSafe-1.1.1 Pillow-7.0.0 Werkzeug-1.0.0 absl-py-0.9.0 alembic-1.4.0 astor-0.8.1 bentoml-0.6.1 boto3-1.11.12 botocore-1.14.12 cerberus-1.3.2 click-7.0 configparser-4.0.2 docker-4.2.0 docutils-0.15.2 flask-1.1.1 gast-0.3.3 google-pasta-0.1.8 grpcio-1.26.0 h5py-2.10.0 humanfriendly-5.0 imageio-2.6.1 itsdangerous-1.1.0 jmespath-0.9.4 keras-2.3.1 keras-applications-1.0.8 keras-preprocessing-1.1.0 markdown-3.1.1 packaging-20.1 pandas-1.0.1 prometheus-client-0.7.1 protobuf-3.11.3 pyparsing-2.4.6 python-dateutil-2.8.0 python-editor-1.0.4 python-json-logger-0.1.11 pytz-2019.3 pyyaml-5.3 ruamel.yaml-0.16.7 ruamel.yaml.clib-0.2.0 s3transfer-0.3.3 sqlalchemy-1.3.13 tabulate-0.8.6 tensorboard-1.14.0 tensorflow-1.14.0 tensorflow-estimator-1.14.0 termcolor-1.1.0 websocket-client-0.57.0 wrapt-1.11.2
Removing intermediate container 96865990f13b
 ---> 4938d97c3c8b
Step 11/12 : RUN if [ -f /bento/bentoml_init.sh ]; then /bin/bash -c /bento/bentoml_init.sh; fi
 ---> Running in 688a3846ad16
Processing ./bundled_pip_dependencies/BentoML-0.6.1+4.gd82c2f1.tar.gz
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'done'
    Preparing wheel metadata: started
    Preparing wheel metadata: finished with status 'done'
Requirement already satisfied, skipping upgrade: pandas in /opt/conda/lib/python3.7/site-packages (from BentoML==0.6.1+4.gd82c2f1) (1.0.1)
Requirement already satisfied, skipping upgrade: ruamel.yaml>=0.15.0 in /opt/conda/lib/python3.7/site-packages (from BentoML==0.6.1+4.gd82c2f1) (0.16.7)
Requirement already satisfied, skipping upgrade: boto3 in /opt/conda/lib/python3.7/site-packages (from BentoML==0.6.1+4.gd82c2f1) (1.11.12)
Requirement already satisfied, skipping upgrade: tabulate in /opt/conda/lib/python3.7/site-packages (from BentoML==0.6.1+4.gd82c2f1) (0.8.6)
Requirement already satisfied, skipping upgrade: cerberus in /opt/conda/lib/python3.7/site-packages (from BentoML==0.6.1+4.gd82c2f1) (1.3.2)
Requirement already satisfied, skipping upgrade: click>=7.0 in /opt/conda/lib/python3.7/site-packages (from BentoML==0.6.1+4.gd82c2f1) (7.0)
Requirement already satisfied, skipping upgrade: python-dateutil<2.8.1,>=2.1 in /opt/conda/lib/python3.7/site-packages (from BentoML==0.6.1+4.gd82c2f1) (2.8.0)
Requirement already satisfied, skipping upgrade: configparser in /opt/conda/lib/python3.7/site-packages (from BentoML==0.6.1+4.gd82c2f1) (4.0.2)
Requirement already satisfied, skipping upgrade: gunicorn in /opt/conda/lib/python3.7/site-packages (from BentoML==0.6.1+4.gd82c2f1) (20.0.4)
Requirement already satisfied, skipping upgrade: flask in /opt/conda/lib/python3.7/site-packages (from BentoML==0.6.1+4.gd82c2f1) (1.1.1)
Requirement already satisfied, skipping upgrade: numpy in /opt/conda/lib/python3.7/site-packages (from BentoML==0.6.1+4.gd82c2f1) (1.18.1)
Requirement already satisfied, skipping upgrade: humanfriendly in /opt/conda/lib/python3.7/site-packages (from BentoML==0.6.1+4.gd82c2f1) (5.0)
Requirement already satisfied, skipping upgrade: grpcio in /opt/conda/lib/python3.7/site-packages (from BentoML==0.6.1+4.gd82c2f1) (1.26.0)
Requirement already satisfied, skipping upgrade: prometheus-client in /opt/conda/lib/python3.7/site-packages (from BentoML==0.6.1+4.gd82c2f1) (0.7.1)
Requirement already satisfied, skipping upgrade: sqlalchemy>=1.3.0 in /opt/conda/lib/python3.7/site-packages (from BentoML==0.6.1+4.gd82c2f1) (1.3.13)
Requirement already satisfied, skipping upgrade: python-json-logger in /opt/conda/lib/python3.7/site-packages (from BentoML==0.6.1+4.gd82c2f1) (0.1.11)
Requirement already satisfied, skipping upgrade: docker in /opt/conda/lib/python3.7/site-packages (from BentoML==0.6.1+4.gd82c2f1) (4.2.0)
Requirement already satisfied, skipping upgrade: protobuf>=3.6.0 in /opt/conda/lib/python3.7/site-packages (from BentoML==0.6.1+4.gd82c2f1) (3.11.3)
Requirement already satisfied, skipping upgrade: packaging in /opt/conda/lib/python3.7/site-packages (from BentoML==0.6.1+4.gd82c2f1) (20.1)
Requirement already satisfied, skipping upgrade: alembic in /opt/conda/lib/python3.7/site-packages (from BentoML==0.6.1+4.gd82c2f1) (1.4.0)
Requirement already satisfied, skipping upgrade: requests in /opt/conda/lib/python3.7/site-packages (from BentoML==0.6.1+4.gd82c2f1) (2.22.0)
Requirement already satisfied, skipping upgrade: pytz>=2017.2 in /opt/conda/lib/python3.7/site-packages (from pandas->BentoML==0.6.1+4.gd82c2f1) (2019.3)
Requirement already satisfied, skipping upgrade: ruamel.yaml.clib>=0.1.2; platform_python_implementation == "CPython" and python_version < "3.8" in /opt/conda/lib/python3.7/site-packages (from ruamel.yaml>=0.15.0->BentoML==0.6.1+4.gd82c2f1) (0.2.0)
Requirement already satisfied, skipping upgrade: s3transfer<0.4.0,>=0.3.0 in /opt/conda/lib/python3.7/site-packages (from boto3->BentoML==0.6.1+4.gd82c2f1) (0.3.3)
Requirement already satisfied, skipping upgrade: botocore<1.15.0,>=1.14.12 in /opt/conda/lib/python3.7/site-packages (from boto3->BentoML==0.6.1+4.gd82c2f1) (1.14.12)
Requirement already satisfied, skipping upgrade: jmespath<1.0.0,>=0.7.1 in /opt/conda/lib/python3.7/site-packages (from boto3->BentoML==0.6.1+4.gd82c2f1) (0.9.4)
Requirement already satisfied, skipping upgrade: setuptools in /opt/conda/lib/python3.7/site-packages (from cerberus->BentoML==0.6.1+4.gd82c2f1) (41.4.0)
Requirement already satisfied, skipping upgrade: six>=1.5 in /opt/conda/lib/python3.7/site-packages (from python-dateutil<2.8.1,>=2.1->BentoML==0.6.1+4.gd82c2f1) (1.12.0)
Requirement already satisfied, skipping upgrade: Werkzeug>=0.15 in /opt/conda/lib/python3.7/site-packages (from flask->BentoML==0.6.1+4.gd82c2f1) (1.0.0)
Requirement already satisfied, skipping upgrade: Jinja2>=2.10.1 in /opt/conda/lib/python3.7/site-packages (from flask->BentoML==0.6.1+4.gd82c2f1) (2.11.1)
Requirement already satisfied, skipping upgrade: itsdangerous>=0.24 in /opt/conda/lib/python3.7/site-packages (from flask->BentoML==0.6.1+4.gd82c2f1) (1.1.0)
Requirement already satisfied, skipping upgrade: websocket-client>=0.32.0 in /opt/conda/lib/python3.7/site-packages (from docker->BentoML==0.6.1+4.gd82c2f1) (0.57.0)
Requirement already satisfied, skipping upgrade: pyparsing>=2.0.2 in /opt/conda/lib/python3.7/site-packages (from packaging->BentoML==0.6.1+4.gd82c2f1) (2.4.6)
Requirement already satisfied, skipping upgrade: python-editor>=0.3 in /opt/conda/lib/python3.7/site-packages (from alembic->BentoML==0.6.1+4.gd82c2f1) (1.0.4)
Requirement already satisfied, skipping upgrade: Mako in /opt/conda/lib/python3.7/site-packages (from alembic->BentoML==0.6.1+4.gd82c2f1) (1.1.1)
Requirement already satisfied, skipping upgrade: chardet<3.1.0,>=3.0.2 in /opt/conda/lib/python3.7/site-packages (from requests->BentoML==0.6.1+4.gd82c2f1) (3.0.4)
Requirement already satisfied, skipping upgrade: idna<2.9,>=2.5 in /opt/conda/lib/python3.7/site-packages (from requests->BentoML==0.6.1+4.gd82c2f1) (2.8)
Requirement already satisfied, skipping upgrade: certifi>=2017.4.17 in /opt/conda/lib/python3.7/site-packages (from requests->BentoML==0.6.1+4.gd82c2f1) (2019.11.28)
Requirement already satisfied, skipping upgrade: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /opt/conda/lib/python3.7/site-packages (from requests->BentoML==0.6.1+4.gd82c2f1) (1.24.2)
Requirement already satisfied, skipping upgrade: docutils<0.16,>=0.10 in /opt/conda/lib/python3.7/site-packages (from botocore<1.15.0,>=1.14.12->boto3->BentoML==0.6.1+4.gd82c2f1) (0.15.2)
Requirement already satisfied, skipping upgrade: MarkupSafe>=0.23 in /opt/conda/lib/python3.7/site-packages (from Jinja2>=2.10.1->flask->BentoML==0.6.1+4.gd82c2f1) (1.1.1)
Building wheels for collected packages: BentoML
  Building wheel for BentoML (PEP 517): started
  Building wheel for BentoML (PEP 517): finished with status 'done'
  Created wheel for BentoML: filename=BentoML-0.6.1+4.gd82c2f1-py3-none-any.whl size=506117 sha256=b3533eba706e9db740b79cd59d80b7af04a449243c038f75bed6b0ff7be5b8f7
  Stored in directory: /root/.cache/pip/wheels/f5/ba/62/fb423f5e56227ee097b20eebe52af6495fe41db7b064bc9d99
Successfully built BentoML
Installing collected packages: BentoML
  Attempting uninstall: BentoML
    Found existing installation: BentoML 0.6.1
    Uninstalling BentoML-0.6.1:
      Successfully uninstalled BentoML-0.6.1
Successfully installed BentoML-0.6.1+4.gd82c2f1
Removing intermediate container 688a3846ad16
 ---> 801d4d73c461
Step 12/12 : CMD ["bentoml serve-gunicorn /bento"]
 ---> Running in df7604859356
Removing intermediate container df7604859356
 ---> 3824ed8d82de
Successfully built 3824ed8d82de
Successfully tagged keras-fashion-mnist:latest
In [37]:
!docker run -p 5000:5000 keras-fashion-mnist
[2020-02-06 22:27:07,808] INFO - get_gunicorn_num_of_workers: 3, calculated by cpu count
[2020-02-06 22:27:08 +0000] [1] [INFO] Starting gunicorn 20.0.4
[2020-02-06 22:27:08 +0000] [1] [INFO] Listening at: http://0.0.0.0:5000 (1)
[2020-02-06 22:27:08 +0000] [1] [INFO] Using worker: sync
[2020-02-06 22:27:08 +0000] [9] [INFO] Booting worker with pid: 9
[2020-02-06 22:27:08 +0000] [10] [INFO] Booting worker with pid: 10
[2020-02-06 22:27:08 +0000] [11] [INFO] Booting worker with pid: 11
[2020-02-06 22:27:08,273] WARNING - Saved BentoService bundle version mismatch: loading BentoServie bundle create with BentoML version 0.6.1,  but loading from BentoML version 0.6.1+4.gd82c2f1
[2020-02-06 22:27:08,396] WARNING - Saved BentoService bundle version mismatch: loading BentoServie bundle create with BentoML version 0.6.1,  but loading from BentoML version 0.6.1+4.gd82c2f1
[2020-02-06 22:27:08,411] WARNING - Saved BentoService bundle version mismatch: loading BentoServie bundle create with BentoML version 0.6.1,  but loading from BentoML version 0.6.1+4.gd82c2f1
2020-02-06 22:27:11.116064: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
2020-02-06 22:27:11.118382: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
2020-02-06 22:27:11.120891: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 2808000000 Hz
2020-02-06 22:27:11.121602: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
2020-02-06 22:27:11.121922: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x5584709b3d60 executing computations on platform Host. Devices:
2020-02-06 22:27:11.121988: I tensorflow/compiler/xla/service/service.cc:175]   StreamExecutor device (0): <undefined>, <undefined>
/opt/conda/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:516: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint8 = np.dtype([("qint8", np.int8, 1)])
/opt/conda/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:517: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_quint8 = np.dtype([("quint8", np.uint8, 1)])
/opt/conda/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:518: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint16 = np.dtype([("qint16", np.int16, 1)])
/opt/conda/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:519: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_quint16 = np.dtype([("quint16", np.uint16, 1)])
/opt/conda/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:520: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint32 = np.dtype([("qint32", np.int32, 1)])
/opt/conda/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:525: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  np_resource = np.dtype([("resource", np.ubyte, 1)])
/opt/conda/lib/python3.7/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:541: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint8 = np.dtype([("qint8", np.int8, 1)])
/opt/conda/lib/python3.7/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:542: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_quint8 = np.dtype([("quint8", np.uint8, 1)])
/opt/conda/lib/python3.7/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:543: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint16 = np.dtype([("qint16", np.int16, 1)])
/opt/conda/lib/python3.7/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:544: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_quint16 = np.dtype([("quint16", np.uint16, 1)])
/opt/conda/lib/python3.7/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:545: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint32 = np.dtype([("qint32", np.int32, 1)])
/opt/conda/lib/python3.7/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:550: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  np_resource = np.dtype([("resource", np.ubyte, 1)])
Using TensorFlow backend.
WARNING:tensorflow:From /opt/conda/lib/python3.7/site-packages/bentoml/artifact/keras_model_artifact.py:114: The name tf.keras.backend.set_session is deprecated. Please use tf.compat.v1.keras.backend.set_session instead.

2020-02-06 22:27:11.125527: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 2808000000 Hz
2020-02-06 22:27:11.126175: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x5584709b5060 executing computations on platform Host. Devices:
2020-02-06 22:27:11.126239: I tensorflow/compiler/xla/service/service.cc:175]   StreamExecutor device (0): <undefined>, <undefined>
/opt/conda/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:516: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint8 = np.dtype([("qint8", np.int8, 1)])
/opt/conda/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:517: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_quint8 = np.dtype([("quint8", np.uint8, 1)])
/opt/conda/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:518: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint16 = np.dtype([("qint16", np.int16, 1)])
/opt/conda/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:519: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_quint16 = np.dtype([("quint16", np.uint16, 1)])
/opt/conda/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:520: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint32 = np.dtype([("qint32", np.int32, 1)])
/opt/conda/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:525: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  np_resource = np.dtype([("resource", np.ubyte, 1)])
/opt/conda/lib/python3.7/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:541: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint8 = np.dtype([("qint8", np.int8, 1)])
/opt/conda/lib/python3.7/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:542: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_quint8 = np.dtype([("quint8", np.uint8, 1)])
/opt/conda/lib/python3.7/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:543: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint16 = np.dtype([("qint16", np.int16, 1)])
/opt/conda/lib/python3.7/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:544: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_quint16 = np.dtype([("quint16", np.uint16, 1)])
/opt/conda/lib/python3.7/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:545: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint32 = np.dtype([("qint32", np.int32, 1)])
/opt/conda/lib/python3.7/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:550: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  np_resource = np.dtype([("resource", np.ubyte, 1)])
Using TensorFlow backend.
WARNING:tensorflow:From /opt/conda/lib/python3.7/site-packages/bentoml/artifact/keras_model_artifact.py:114: The name tf.keras.backend.set_session is deprecated. Please use tf.compat.v1.keras.backend.set_session instead.

2020-02-06 22:27:11.138832: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 2808000000 Hz
2020-02-06 22:27:11.139189: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x5584709b3d60 executing computations on platform Host. Devices:
2020-02-06 22:27:11.139229: I tensorflow/compiler/xla/service/service.cc:175]   StreamExecutor device (0): <undefined>, <undefined>
/opt/conda/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:516: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint8 = np.dtype([("qint8", np.int8, 1)])
/opt/conda/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:517: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_quint8 = np.dtype([("quint8", np.uint8, 1)])
/opt/conda/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:518: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint16 = np.dtype([("qint16", np.int16, 1)])
/opt/conda/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:519: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_quint16 = np.dtype([("quint16", np.uint16, 1)])
/opt/conda/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:520: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint32 = np.dtype([("qint32", np.int32, 1)])
/opt/conda/lib/python3.7/site-packages/tensorflow/python/framework/dtypes.py:525: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  np_resource = np.dtype([("resource", np.ubyte, 1)])
/opt/conda/lib/python3.7/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:541: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint8 = np.dtype([("qint8", np.int8, 1)])
/opt/conda/lib/python3.7/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:542: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_quint8 = np.dtype([("quint8", np.uint8, 1)])
/opt/conda/lib/python3.7/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:543: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint16 = np.dtype([("qint16", np.int16, 1)])
/opt/conda/lib/python3.7/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:544: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_quint16 = np.dtype([("quint16", np.uint16, 1)])
/opt/conda/lib/python3.7/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:545: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint32 = np.dtype([("qint32", np.int32, 1)])
/opt/conda/lib/python3.7/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:550: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  np_resource = np.dtype([("resource", np.ubyte, 1)])
Using TensorFlow backend.
WARNING:tensorflow:From /opt/conda/lib/python3.7/site-packages/bentoml/artifact/keras_model_artifact.py:114: The name tf.keras.backend.set_session is deprecated. Please use tf.compat.v1.keras.backend.set_session instead.

WARNING:tensorflow:From /opt/conda/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py:4070: The name tf.nn.max_pool is deprecated. Please use tf.nn.max_pool2d instead.

WARNING:tensorflow:From /opt/conda/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py:4070: The name tf.nn.max_pool is deprecated. Please use tf.nn.max_pool2d instead.

WARNING:tensorflow:From /opt/conda/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py:4070: The name tf.nn.max_pool is deprecated. Please use tf.nn.max_pool2d instead.

2020-02-06 22:27:11.456196: W tensorflow/compiler/jit/mark_for_compilation_pass.cc:1412] (One-time warning): Not using XLA:CPU for cluster because envvar TF_XLA_FLAGS=--tf_xla_cpu_global_jit was not set.  If you want XLA:CPU, either set that envvar, or use experimental_jit_scope to enable XLA:CPU.  To confirm that XLA is active, pass --vmodule=xla_compilation_cache=1 (as a proper command-line flag, not via TF_XLA_FLAGS) or set the envvar XLA_FLAGS=--xla_hlo_profile.
2020-02-06 22:27:11.457469: W tensorflow/compiler/jit/mark_for_compilation_pass.cc:1412] (One-time warning): Not using XLA:CPU for cluster because envvar TF_XLA_FLAGS=--tf_xla_cpu_global_jit was not set.  If you want XLA:CPU, either set that envvar, or use experimental_jit_scope to enable XLA:CPU.  To confirm that XLA is active, pass --vmodule=xla_compilation_cache=1 (as a proper command-line flag, not via TF_XLA_FLAGS) or set the envvar XLA_FLAGS=--xla_hlo_profile.
2020-02-06 22:27:11.479978: W tensorflow/compiler/jit/mark_for_compilation_pass.cc:1412] (One-time warning): Not using XLA:CPU for cluster because envvar TF_XLA_FLAGS=--tf_xla_cpu_global_jit was not set.  If you want XLA:CPU, either set that envvar, or use experimental_jit_scope to enable XLA:CPU.  To confirm that XLA is active, pass --vmodule=xla_compilation_cache=1 (as a proper command-line flag, not via TF_XLA_FLAGS) or set the envvar XLA_FLAGS=--xla_hlo_profile.
WARNING:tensorflow:From /opt/conda/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py:422: The name tf.global_variables is deprecated. Please use tf.compat.v1.global_variables instead.

WARNING:tensorflow:From /opt/conda/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py:422: The name tf.global_variables is deprecated. Please use tf.compat.v1.global_variables instead.

WARNING:tensorflow:From /opt/conda/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py:422: The name tf.global_variables is deprecated. Please use tf.compat.v1.global_variables instead.

WARNING:tensorflow:From /opt/conda/lib/python3.7/site-packages/bentoml/artifact/keras_model_artifact.py:100: The name tf.keras.backend.get_session is deprecated. Please use tf.compat.v1.keras.backend.get_session instead.

WARNING:tensorflow:From /opt/conda/lib/python3.7/site-packages/bentoml/artifact/keras_model_artifact.py:100: The name tf.keras.backend.get_session is deprecated. Please use tf.compat.v1.keras.backend.get_session instead.

WARNING:tensorflow:From /opt/conda/lib/python3.7/site-packages/bentoml/artifact/keras_model_artifact.py:100: The name tf.keras.backend.get_session is deprecated. Please use tf.compat.v1.keras.backend.get_session instead.

^C
[2020-02-06 22:27:26 +0000] [1] [INFO] Handling signal: int
[2020-02-06 22:27:26 +0000] [9] [INFO] Worker exiting (pid: 9)
[2020-02-06 22:27:26 +0000] [10] [INFO] Worker exiting (pid: 10)
[2020-02-06 22:27:26 +0000] [11] [INFO] Worker exiting (pid: 11)

Deploy BentoService as REST API server to the cloud

BentoML support deployment to multiply cloud provider services, such as AWS Lambda, AWS Sagemaker, Google Cloudrun and etc. You can find the full list and guide on the documentation site at https://docs.bentoml.org/en/latest/deployment/index.html

For this demo, we are going to deploy to AWS Sagemaker

Use bentoml sagemaker deploy to deploy BentoService

In [45]:
!bentoml sagemaker deploy test-keras-mnist -b KerasFashionMnistService:20200206114430_94F93D --api-name predict --verbose
[2020-02-06 15:47:57,164] DEBUG - Using BentoML with local Yatai server
[2020-02-06 15:47:57,322] DEBUG - Upgrading tables to the latest revision
Deploying Sagemaker deployment /[2020-02-06 15:47:58,250] DEBUG - Created temporary directory: /private/var/folders/kn/xnc9k74x03567n1mx2tfqnpr0000gn/T/bentoml-temp-5a0fqpd0
/[2020-02-06 15:47:58,749] DEBUG - Getting docker login info from AWS
[2020-02-06 15:47:58,750] DEBUG - Building docker image: 192023623294.dkr.ecr.us-west-2.amazonaws.com/kerasfashionmnistservice-sagemaker:20200206114430_94F93D
|[2020-02-06 15:47:59,254] INFO - Step 1/11 : FROM continuumio/miniconda3:4.7.12
[2020-02-06 15:47:59,255] INFO - 

[2020-02-06 15:47:59,255] INFO -  ---> 406f2b43ea59

[2020-02-06 15:47:59,255] INFO - Step 2/11 : EXPOSE 8080
[2020-02-06 15:47:59,255] INFO - 

[2020-02-06 15:47:59,255] INFO -  ---> Using cache

[2020-02-06 15:47:59,255] INFO -  ---> 7c8096d6922f

[2020-02-06 15:47:59,256] INFO - Step 3/11 : RUN set -x      && apt-get update      && apt-get install --no-install-recommends --no-install-suggests -y libpq-dev build-essential     && apt-get install -y nginx      && rm -rf /var/lib/apt/lists/*
[2020-02-06 15:47:59,256] INFO - 

[2020-02-06 15:47:59,256] INFO -  ---> Using cache

[2020-02-06 15:47:59,256] INFO -  ---> 5b00a58f3bce

[2020-02-06 15:47:59,256] INFO - Step 4/11 : RUN conda install pip numpy scipy       && pip install gunicorn gevent
[2020-02-06 15:47:59,256] INFO - 

[2020-02-06 15:47:59,256] INFO -  ---> Using cache

[2020-02-06 15:47:59,256] INFO -  ---> 25aacb592861

[2020-02-06 15:47:59,256] INFO - Step 5/11 : COPY . /opt/program
[2020-02-06 15:47:59,256] INFO - 

[2020-02-06 15:47:59,257] INFO -  ---> Using cache

[2020-02-06 15:47:59,257] INFO -  ---> 08c17a7f8587

[2020-02-06 15:47:59,257] INFO - Step 6/11 : WORKDIR /opt/program
[2020-02-06 15:47:59,257] INFO - 

[2020-02-06 15:47:59,258] INFO -  ---> Using cache

[2020-02-06 15:47:59,258] INFO -  ---> d9f3fbf48d85

[2020-02-06 15:47:59,258] INFO - Step 7/11 : RUN conda env update -n base -f /opt/program/environment.yml
[2020-02-06 15:47:59,258] INFO - 

[2020-02-06 15:47:59,259] INFO -  ---> Using cache

[2020-02-06 15:47:59,259] INFO -  ---> 567b535fc570

[2020-02-06 15:47:59,259] INFO - Step 8/11 : RUN pip install -r /opt/program/requirements.txt
[2020-02-06 15:47:59,259] INFO - 

[2020-02-06 15:47:59,260] INFO -  ---> Using cache

[2020-02-06 15:47:59,260] INFO -  ---> 1f8608b8334d

[2020-02-06 15:47:59,260] INFO - Step 9/11 : RUN if [ -f /bento/bentoml_init.sh ]; then /bin/bash -c /bento/bentoml_init.sh; fi
[2020-02-06 15:47:59,260] INFO - 

[2020-02-06 15:47:59,261] INFO -  ---> Using cache

[2020-02-06 15:47:59,261] INFO -  ---> 8cf7fc288e50

[2020-02-06 15:47:59,261] INFO - Step 10/11 : RUN if [ -f /opt/program/setup.sh ]; then /bin/bash -c /opt/program/setup.sh; fi
[2020-02-06 15:47:59,261] INFO - 

[2020-02-06 15:47:59,262] INFO -  ---> Using cache

[2020-02-06 15:47:59,262] INFO -  ---> e019d4674199

[2020-02-06 15:47:59,262] INFO - Step 11/11 : ENV PATH="/opt/program:${PATH}"
[2020-02-06 15:47:59,262] INFO - 

[2020-02-06 15:47:59,262] INFO -  ---> Using cache

[2020-02-06 15:47:59,263] INFO -  ---> d70d1c09b5ea

\[2020-02-06 15:47:59,268] INFO - Successfully built d70d1c09b5ea

[2020-02-06 15:47:59,270] INFO - Successfully tagged 192023623294.dkr.ecr.us-west-2.amazonaws.com/kerasfashionmnistservice-sagemaker:20200206114430_94F93D

[2020-02-06 15:47:59,321] DEBUG - Pushing image to AWS ECR at 192023623294.dkr.ecr.us-west-2.amazonaws.com/kerasfashionmnistservice-sagemaker:20200206114430_94F93D
\[2020-02-06 15:48:00,543] DEBUG - Finished pushing image: 192023623294.dkr.ecr.us-west-2.amazonaws.com/kerasfashionmnistservice-sagemaker:20200206114430_94F93D
[2020-02-06 15:48:00,547] DEBUG - BentoML in debug mode, keeping temp directory "/private/var/folders/kn/xnc9k74x03567n1mx2tfqnpr0000gn/T/bentoml-temp-5a0fqpd0"
\[2020-02-06 15:48:01,739] DEBUG - AWS create model response: {'ModelArn': 'arn:aws:sagemaker:us-west-2:192023623294:model/bobo-test-keras-m-kerasfashionmnistser-20200206114430-94f93d', 'ResponseMetadata': {'RequestId': '4669baa9-8f17-450b-8487-844c14ad1466', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': '4669baa9-8f17-450b-8487-844c14ad1466', 'content-type': 'application/x-amz-json-1.1', 'content-length': '122', 'date': 'Thu, 06 Feb 2020 23:48:02 GMT'}, 'RetryAttempts': 0}}
[2020-02-06 15:48:01,740] DEBUG - Creating Sagemaker endpoint bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D configuration
-[2020-02-06 15:48:01,815] DEBUG - AWS create endpoint config response: {'EndpointConfigArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint-config/bobo-test-keras-m-kerasfashionmnistser-20200206114430-94f93d', 'ResponseMetadata': {'RequestId': 'b3554ad9-5395-46da-bfa5-bfae0b7ff9c5', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': 'b3554ad9-5395-46da-bfa5-bfae0b7ff9c5', 'content-type': 'application/x-amz-json-1.1', 'content-length': '141', 'date': 'Thu, 06 Feb 2020 23:48:02 GMT'}, 'RetryAttempts': 0}}
[2020-02-06 15:48:01,816] DEBUG - Creating sagemaker endpoint bobo-test-keras-mnist
|[2020-02-06 15:48:02,045] DEBUG - AWS create endpoint response: {'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'ResponseMetadata': {'RequestId': '4dba220f-1d37-44a0-9233-c80bbfbd62e8', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': '4dba220f-1d37-44a0-9233-c80bbfbd62e8', 'content-type': 'application/x-amz-json-1.1', 'content-length': '89', 'date': 'Thu, 06 Feb 2020 23:48:02 GMT'}, 'RetryAttempts': 0}}
[2020-02-06 15:48:02,059] INFO - ApplyDeployment (test-keras-mnist, namespace bobo) succeeded
-[2020-02-06 15:48:02,316] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': '04e4e058-7f82-4afe-a0ba-0cd6abb3082d', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': '04e4e058-7f82-4afe-a0ba-0cd6abb3082d', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:48:02 GMT'}, 'RetryAttempts': 0}}
-[2020-02-06 15:48:07,586] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': '44ddea2f-0d7d-4e3b-a800-015512787ada', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': '44ddea2f-0d7d-4e3b-a800-015512787ada', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:48:07 GMT'}, 'RetryAttempts': 0}}
\[2020-02-06 15:48:12,820] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': 'd6a073ea-0740-44fc-a61d-76ccafaba5c5', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': 'd6a073ea-0740-44fc-a61d-76ccafaba5c5', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:48:13 GMT'}, 'RetryAttempts': 0}}
|[2020-02-06 15:48:18,061] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': '87af2f8f-22d0-4aa6-8cb1-975fb1855da3', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': '87af2f8f-22d0-4aa6-8cb1-975fb1855da3', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:48:18 GMT'}, 'RetryAttempts': 0}}
/[2020-02-06 15:48:23,286] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': '221e1c46-4acd-4152-a82b-8d9e411dbb4b', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': '221e1c46-4acd-4152-a82b-8d9e411dbb4b', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:48:23 GMT'}, 'RetryAttempts': 0}}
-[2020-02-06 15:48:28,488] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': '8f95daf4-22fb-402f-9c04-4d994402f61b', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': '8f95daf4-22fb-402f-9c04-4d994402f61b', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:48:28 GMT'}, 'RetryAttempts': 0}}
\[2020-02-06 15:48:33,691] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': 'c84223e5-2c17-460c-9455-a5782abf3e9a', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': 'c84223e5-2c17-460c-9455-a5782abf3e9a', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:48:34 GMT'}, 'RetryAttempts': 0}}
|[2020-02-06 15:48:38,940] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': '0e865de3-579f-4277-ad6d-e3f3252b2118', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': '0e865de3-579f-4277-ad6d-e3f3252b2118', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:48:38 GMT'}, 'RetryAttempts': 0}}
/[2020-02-06 15:48:44,183] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': 'd2ab626c-e618-48be-aedf-798d216ceb39', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': 'd2ab626c-e618-48be-aedf-798d216ceb39', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:48:44 GMT'}, 'RetryAttempts': 0}}
-[2020-02-06 15:48:49,410] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': '7ef0e0d1-37dc-4941-a480-ed64f3ad66ca', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': '7ef0e0d1-37dc-4941-a480-ed64f3ad66ca', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:48:49 GMT'}, 'RetryAttempts': 0}}
\[2020-02-06 15:48:54,645] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': 'cf9f9a46-15f1-49be-92b9-9c10238228a6', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': 'cf9f9a46-15f1-49be-92b9-9c10238228a6', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:48:54 GMT'}, 'RetryAttempts': 0}}
|[2020-02-06 15:48:59,865] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': '8c0fb67f-3c87-432e-a6b7-304481f0cf58', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': '8c0fb67f-3c87-432e-a6b7-304481f0cf58', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:49:00 GMT'}, 'RetryAttempts': 0}}
/[2020-02-06 15:49:05,093] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': 'bda262b6-2d70-48b1-b419-cb29309d72e4', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': 'bda262b6-2d70-48b1-b419-cb29309d72e4', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:49:05 GMT'}, 'RetryAttempts': 0}}
-[2020-02-06 15:49:10,315] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': '90aa2920-716e-4b47-987b-451ceb2c3752', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': '90aa2920-716e-4b47-987b-451ceb2c3752', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:49:10 GMT'}, 'RetryAttempts': 0}}
\[2020-02-06 15:49:15,543] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': '8f62cc12-01ab-4dac-9077-b6c380c6db2a', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': '8f62cc12-01ab-4dac-9077-b6c380c6db2a', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:49:15 GMT'}, 'RetryAttempts': 0}}
\[2020-02-06 15:49:20,799] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': '0d624137-8397-4902-be62-4aa9ad14e02d', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': '0d624137-8397-4902-be62-4aa9ad14e02d', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:49:21 GMT'}, 'RetryAttempts': 0}}
|[2020-02-06 15:49:26,030] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': 'd0e939ca-b107-47a9-9e3a-7bf000e42ca4', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': 'd0e939ca-b107-47a9-9e3a-7bf000e42ca4', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:49:26 GMT'}, 'RetryAttempts': 0}}
/[2020-02-06 15:49:31,266] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': '09d24af3-ed92-47e7-bc08-fb71f0438e8a', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': '09d24af3-ed92-47e7-bc08-fb71f0438e8a', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:49:31 GMT'}, 'RetryAttempts': 0}}
/[2020-02-06 15:49:36,938] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': 'd97ed8bf-53f0-467f-a241-da752e557cac', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': 'd97ed8bf-53f0-467f-a241-da752e557cac', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:49:36 GMT'}, 'RetryAttempts': 0}}
-[2020-02-06 15:49:42,159] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': 'd0415f5f-d113-4e45-9464-d44d782f3950', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': 'd0415f5f-d113-4e45-9464-d44d782f3950', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:49:42 GMT'}, 'RetryAttempts': 0}}
\[2020-02-06 15:49:47,380] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': '6cfdc89b-1bfd-47ff-a2bd-499fcf58012c', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': '6cfdc89b-1bfd-47ff-a2bd-499fcf58012c', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:49:47 GMT'}, 'RetryAttempts': 0}}
-[2020-02-06 15:49:53,597] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': '8d3a8104-7be8-4ed0-a1cc-484ee3ed6de6', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': '8d3a8104-7be8-4ed0-a1cc-484ee3ed6de6', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:49:54 GMT'}, 'RetryAttempts': 0}}
|[2020-02-06 15:49:58,799] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': '5dc90373-f1fc-47c1-afd3-f5f00b8f0691', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': '5dc90373-f1fc-47c1-afd3-f5f00b8f0691', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:49:59 GMT'}, 'RetryAttempts': 0}}
/[2020-02-06 15:50:04,022] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': 'e3e38b0e-4d98-47a1-b09c-39d58b7a2bc7', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': 'e3e38b0e-4d98-47a1-b09c-39d58b7a2bc7', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:50:04 GMT'}, 'RetryAttempts': 0}}
-[2020-02-06 15:50:09,238] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': '878d6ff8-7765-40a0-b746-4f9752132fc5', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': '878d6ff8-7765-40a0-b746-4f9752132fc5', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:50:09 GMT'}, 'RetryAttempts': 0}}
\[2020-02-06 15:50:14,446] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': '6c2e00fc-88bd-40ca-91b6-adb888320c41', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': '6c2e00fc-88bd-40ca-91b6-adb888320c41', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:50:15 GMT'}, 'RetryAttempts': 0}}
|[2020-02-06 15:50:19,656] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': '4717407f-7669-4c32-9255-af0510369a56', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': '4717407f-7669-4c32-9255-af0510369a56', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:50:19 GMT'}, 'RetryAttempts': 0}}
/[2020-02-06 15:50:24,859] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': '612dd325-30e2-49ca-b09b-2626a742fe08', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': '612dd325-30e2-49ca-b09b-2626a742fe08', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:50:25 GMT'}, 'RetryAttempts': 0}}
-[2020-02-06 15:50:30,061] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': '2c0ef7e4-e7a8-4a6a-babc-d11dd38d933c', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': '2c0ef7e4-e7a8-4a6a-babc-d11dd38d933c', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:50:30 GMT'}, 'RetryAttempts': 0}}
\[2020-02-06 15:50:35,300] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': '8466e073-e658-409d-9abd-53802f788f49', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': '8466e073-e658-409d-9abd-53802f788f49', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:50:35 GMT'}, 'RetryAttempts': 0}}
|[2020-02-06 15:50:40,535] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': '042e6d59-fe61-43fb-88e3-ecd49742c631', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': '042e6d59-fe61-43fb-88e3-ecd49742c631', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:50:40 GMT'}, 'RetryAttempts': 0}}
/[2020-02-06 15:50:45,766] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': '05c980b3-03df-465b-999a-f54e2da76b1f', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': '05c980b3-03df-465b-999a-f54e2da76b1f', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:50:45 GMT'}, 'RetryAttempts': 0}}
-[2020-02-06 15:50:50,975] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': 'f17b6938-0e0c-4869-8b27-4dd8b550ab65', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': 'f17b6938-0e0c-4869-8b27-4dd8b550ab65', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:50:51 GMT'}, 'RetryAttempts': 0}}
\[2020-02-06 15:50:56,191] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': 'fbaa25d4-b7ca-433a-90ee-d0a9a2c340d0', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': 'fbaa25d4-b7ca-433a-90ee-d0a9a2c340d0', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:50:56 GMT'}, 'RetryAttempts': 0}}
-[2020-02-06 15:51:05,718] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': '90db8fe7-ac64-4c0f-9afb-396d2ad57797', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': '90db8fe7-ac64-4c0f-9afb-396d2ad57797', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:51:06 GMT'}, 'RetryAttempts': 0}}
\[2020-02-06 15:51:10,914] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': 'cc8d442e-a256-4e34-9d40-774d618e455f', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': 'cc8d442e-a256-4e34-9d40-774d618e455f', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:51:11 GMT'}, 'RetryAttempts': 0}}
|[2020-02-06 15:51:16,136] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': '82420026-b387-4542-9f4d-2fdfcf8d3129', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': '82420026-b387-4542-9f4d-2fdfcf8d3129', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:51:16 GMT'}, 'RetryAttempts': 0}}
/[2020-02-06 15:51:21,356] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': 'b10e77b5-f4d0-4e8e-a0ce-c0622228fc3f', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': 'b10e77b5-f4d0-4e8e-a0ce-c0622228fc3f', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:51:21 GMT'}, 'RetryAttempts': 0}}
-[2020-02-06 15:51:26,564] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': '33c428f1-4534-46c8-ac0b-ece30a85015a', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': '33c428f1-4534-46c8-ac0b-ece30a85015a', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:51:27 GMT'}, 'RetryAttempts': 0}}
\[2020-02-06 15:51:31,771] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': 'a99bb051-8b08-431b-8c38-1ff6ff967595', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': 'a99bb051-8b08-431b-8c38-1ff6ff967595', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:51:31 GMT'}, 'RetryAttempts': 0}}
|[2020-02-06 15:51:36,980] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': 'd984d16a-cd94-4cdb-916b-68969cc562c7', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': 'd984d16a-cd94-4cdb-916b-68969cc562c7', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:51:37 GMT'}, 'RetryAttempts': 0}}
/[2020-02-06 15:51:42,193] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': '2201faac-c59e-49ef-815c-8ed04fe2d250', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': '2201faac-c59e-49ef-815c-8ed04fe2d250', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:51:42 GMT'}, 'RetryAttempts': 0}}
/[2020-02-06 15:51:47,402] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': 'a6d19512-fa2e-41c2-9280-8e74faf9ca75', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': 'a6d19512-fa2e-41c2-9280-8e74faf9ca75', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:51:48 GMT'}, 'RetryAttempts': 0}}
-[2020-02-06 15:51:52,655] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': '97890b23-160a-45e8-bf97-808e3fa97acb', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': '97890b23-160a-45e8-bf97-808e3fa97acb', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:51:53 GMT'}, 'RetryAttempts': 0}}
\[2020-02-06 15:51:57,887] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': '9351f034-3aa2-45b8-9085-461084ac4a96', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': '9351f034-3aa2-45b8-9085-461084ac4a96', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:51:58 GMT'}, 'RetryAttempts': 0}}
|[2020-02-06 15:52:03,093] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': 'b566afb7-9852-4cbb-8e09-4d4390c50888', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': 'b566afb7-9852-4cbb-8e09-4d4390c50888', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:52:03 GMT'}, 'RetryAttempts': 0}}
/[2020-02-06 15:52:08,312] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': 'f845caf1-296c-4f65-bfb3-c721874dbe11', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': 'f845caf1-296c-4f65-bfb3-c721874dbe11', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:52:09 GMT'}, 'RetryAttempts': 0}}
|[2020-02-06 15:52:14,531] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': '3ec88b65-7132-4ae2-839c-60c617e1ad54', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': '3ec88b65-7132-4ae2-839c-60c617e1ad54', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:52:14 GMT'}, 'RetryAttempts': 0}}
/[2020-02-06 15:52:19,736] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': '6ce3115d-0d8f-4f5f-846b-953b643a5976', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': '6ce3115d-0d8f-4f5f-846b-953b643a5976', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:52:20 GMT'}, 'RetryAttempts': 0}}
-[2020-02-06 15:52:24,946] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': '529e7257-0af0-4601-ba8b-ebca52c2a9e0', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': '529e7257-0af0-4601-ba8b-ebca52c2a9e0', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:52:24 GMT'}, 'RetryAttempts': 0}}
\[2020-02-06 15:52:30,181] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': '018ad260-b5d2-43cc-9b29-5b12ecc8bc5c', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': '018ad260-b5d2-43cc-9b29-5b12ecc8bc5c', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:52:30 GMT'}, 'RetryAttempts': 0}}
|[2020-02-06 15:52:35,395] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': 'eeba31c7-3436-4c66-aab4-f3a20ccb2669', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': 'eeba31c7-3436-4c66-aab4-f3a20ccb2669', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:52:35 GMT'}, 'RetryAttempts': 0}}
/[2020-02-06 15:52:40,607] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': '09dc246d-e2d5-49b4-8405-4271db81b22d', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': '09dc246d-e2d5-49b4-8405-4271db81b22d', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:52:40 GMT'}, 'RetryAttempts': 0}}
-[2020-02-06 15:52:45,811] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': '9e517cef-19aa-4b72-80fb-7a230e2c55d9', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': '9e517cef-19aa-4b72-80fb-7a230e2c55d9', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:52:46 GMT'}, 'RetryAttempts': 0}}
\[2020-02-06 15:52:51,021] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': '3daf1f36-6753-4d87-97fd-4affb9d0c5cb', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': '3daf1f36-6753-4d87-97fd-4affb9d0c5cb', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:52:51 GMT'}, 'RetryAttempts': 0}}
/[2020-02-06 15:52:56,250] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': 'e19a0615-60e4-47c7-8509-173cc489464e', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': 'e19a0615-60e4-47c7-8509-173cc489464e', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:52:56 GMT'}, 'RetryAttempts': 0}}
-[2020-02-06 15:53:01,455] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': 'f667f948-3951-4cf0-8d39-f0e5accedbda', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': 'f667f948-3951-4cf0-8d39-f0e5accedbda', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:53:02 GMT'}, 'RetryAttempts': 0}}
\[2020-02-06 15:53:06,672] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': 'ccfa796c-c7bf-42de-86ae-dcaa8cd0d42a', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': 'ccfa796c-c7bf-42de-86ae-dcaa8cd0d42a', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:53:07 GMT'}, 'RetryAttempts': 0}}
|[2020-02-06 15:53:11,914] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': '1cf39b44-e5a5-4c23-ba8b-417e7efef0c5', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': '1cf39b44-e5a5-4c23-ba8b-417e7efef0c5', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:53:12 GMT'}, 'RetryAttempts': 0}}
/[2020-02-06 15:53:17,121] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': '8a0a9160-960f-405f-8f1e-390a8c967c0e', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': '8a0a9160-960f-405f-8f1e-390a8c967c0e', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:53:17 GMT'}, 'RetryAttempts': 0}}
-[2020-02-06 15:53:22,319] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': '4f95c102-121d-45d6-b313-5be04a3af61c', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': '4f95c102-121d-45d6-b313-5be04a3af61c', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:53:22 GMT'}, 'RetryAttempts': 0}}
-[2020-02-06 15:53:27,558] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': '94756887-2566-46cb-a082-ac531220d2ce', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': '94756887-2566-46cb-a082-ac531220d2ce', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:53:27 GMT'}, 'RetryAttempts': 0}}
|[2020-02-06 15:53:32,772] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': '9981a12b-ab7c-4aba-8002-5afd8b3757d2', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': '9981a12b-ab7c-4aba-8002-5afd8b3757d2', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:53:33 GMT'}, 'RetryAttempts': 0}}
/[2020-02-06 15:53:37,991] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': 'ecb437c9-84ea-4a3b-81c4-82bd7a68bf2e', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': 'ecb437c9-84ea-4a3b-81c4-82bd7a68bf2e', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:53:38 GMT'}, 'RetryAttempts': 0}}
-[2020-02-06 15:53:43,187] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': '5a5c45b1-c690-4bc1-8dad-3ae78c2192ed', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': '5a5c45b1-c690-4bc1-8dad-3ae78c2192ed', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:53:44 GMT'}, 'RetryAttempts': 0}}
\[2020-02-06 15:53:48,397] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': 'fd13f4f3-ee47-4cfb-b5af-5534bb101ff8', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': 'fd13f4f3-ee47-4cfb-b5af-5534bb101ff8', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:53:48 GMT'}, 'RetryAttempts': 0}}
\[2020-02-06 15:53:53,606] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': '2bfaa3e7-f73c-433b-a734-98445647cc0a', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': '2bfaa3e7-f73c-433b-a734-98445647cc0a', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:53:54 GMT'}, 'RetryAttempts': 0}}
|[2020-02-06 15:53:58,825] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': 'ab16a0e6-b8e4-4eab-b495-8a55046da829', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': 'ab16a0e6-b8e4-4eab-b495-8a55046da829', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:53:58 GMT'}, 'RetryAttempts': 0}}
/[2020-02-06 15:54:04,040] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': 'b5cf011f-31f2-4708-95b4-577dc9c80485', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': 'b5cf011f-31f2-4708-95b4-577dc9c80485', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:54:04 GMT'}, 'RetryAttempts': 0}}
-[2020-02-06 15:54:09,262] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': 'e8ef21bc-4556-4fe7-a4f6-54c7104548f0', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': 'e8ef21bc-4556-4fe7-a4f6-54c7104548f0', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:54:09 GMT'}, 'RetryAttempts': 0}}
\[2020-02-06 15:54:14,472] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': '35f906c7-e791-4231-a733-5bff2fa0d1f6', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': '35f906c7-e791-4231-a733-5bff2fa0d1f6', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:54:14 GMT'}, 'RetryAttempts': 0}}
|[2020-02-06 15:54:19,679] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': '99882e10-7d14-411c-9d83-cadeb434cfd7', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': '99882e10-7d14-411c-9d83-cadeb434cfd7', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:54:20 GMT'}, 'RetryAttempts': 0}}
/[2020-02-06 15:54:24,882] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': '90f4c0cd-319b-42f3-ab20-1c41445c0ddb', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': '90f4c0cd-319b-42f3-ab20-1c41445c0ddb', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:54:24 GMT'}, 'RetryAttempts': 0}}
/[2020-02-06 15:54:30,138] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': '43c58807-31f7-462d-b1af-390c911209f8', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': '43c58807-31f7-462d-b1af-390c911209f8', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:54:30 GMT'}, 'RetryAttempts': 0}}
-[2020-02-06 15:54:35,343] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': '88af3f09-2409-4482-978f-081e07fee558', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': '88af3f09-2409-4482-978f-081e07fee558', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:54:35 GMT'}, 'RetryAttempts': 0}}
|[2020-02-06 15:54:40,907] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': 'a50d3c7b-bebe-4f42-a407-2bce9c0fb62f', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': 'a50d3c7b-bebe-4f42-a407-2bce9c0fb62f', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:54:40 GMT'}, 'RetryAttempts': 0}}
/[2020-02-06 15:54:46,128] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': '279b45db-6ed3-4347-9d4b-d2bc86f7fd60', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': '279b45db-6ed3-4347-9d4b-d2bc86f7fd60', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:54:47 GMT'}, 'RetryAttempts': 0}}
-[2020-02-06 15:54:51,336] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': 'f77d172c-3466-40a3-9b49-568fc1c89516', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': 'f77d172c-3466-40a3-9b49-568fc1c89516', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:54:52 GMT'}, 'RetryAttempts': 0}}
\[2020-02-06 15:54:56,544] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': '8e8884d8-7dac-44d5-b7f7-d4a367402418', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': '8e8884d8-7dac-44d5-b7f7-d4a367402418', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:54:56 GMT'}, 'RetryAttempts': 0}}
|[2020-02-06 15:55:01,755] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': '6ea8a4a9-89e8-4c3e-85d0-67334a545741', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': '6ea8a4a9-89e8-4c3e-85d0-67334a545741', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:55:01 GMT'}, 'RetryAttempts': 0}}
/[2020-02-06 15:55:06,977] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': 'c2e17676-5012-4fca-bb11-93cc6b617a8c', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': 'c2e17676-5012-4fca-bb11-93cc6b617a8c', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:55:06 GMT'}, 'RetryAttempts': 0}}
-[2020-02-06 15:55:12,198] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': '643091a6-6887-4f78-a880-98a64a0796db', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': '643091a6-6887-4f78-a880-98a64a0796db', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:55:13 GMT'}, 'RetryAttempts': 0}}
\[2020-02-06 15:55:17,401] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': 'fa8a06de-7d77-4925-8903-290b2816aa3b', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': 'fa8a06de-7d77-4925-8903-290b2816aa3b', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:55:17 GMT'}, 'RetryAttempts': 0}}
|[2020-02-06 15:55:22,600] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': '015c16fc-0793-4c27-bdab-2046c1a14368', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': '015c16fc-0793-4c27-bdab-2046c1a14368', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:55:23 GMT'}, 'RetryAttempts': 0}}
/[2020-02-06 15:55:27,820] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': 'a0b69f78-13d3-44c8-8594-2b42b9e72fd7', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': 'a0b69f78-13d3-44c8-8594-2b42b9e72fd7', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:55:28 GMT'}, 'RetryAttempts': 0}}
-[2020-02-06 15:55:33,033] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': 'e85c31b7-d469-4e5b-b614-c53560ecfb4a', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': 'e85c31b7-d469-4e5b-b614-c53560ecfb4a', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:55:33 GMT'}, 'RetryAttempts': 0}}
\[2020-02-06 15:55:38,245] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': '03e77957-a422-4b70-a3d5-39e797cc925f', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': '03e77957-a422-4b70-a3d5-39e797cc925f', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:55:38 GMT'}, 'RetryAttempts': 0}}
|[2020-02-06 15:55:43,453] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': 'e79d916e-bb6a-4a46-abf4-d4cb23e6eb04', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': 'e79d916e-bb6a-4a46-abf4-d4cb23e6eb04', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:55:43 GMT'}, 'RetryAttempts': 0}}
/[2020-02-06 15:55:48,682] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': '3cd51110-b7f7-479c-ae1e-b279512b2dc4', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': '3cd51110-b7f7-479c-ae1e-b279512b2dc4', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:55:49 GMT'}, 'RetryAttempts': 0}}
-[2020-02-06 15:55:53,903] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': 'c9fb9e18-ddec-4998-9d06-4e6e2bdb4f21', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': 'c9fb9e18-ddec-4998-9d06-4e6e2bdb4f21', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:55:54 GMT'}, 'RetryAttempts': 0}}
\[2020-02-06 15:55:59,121] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': '24c86717-fb78-4968-967c-b743d8d07cab', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': '24c86717-fb78-4968-967c-b743d8d07cab', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:55:59 GMT'}, 'RetryAttempts': 0}}
|[2020-02-06 15:56:04,331] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': 'b56a42cb-ad8d-4538-9011-4839353c453f', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': 'b56a42cb-ad8d-4538-9011-4839353c453f', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:56:05 GMT'}, 'RetryAttempts': 0}}
-[2020-02-06 15:56:09,532] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': 'fe342455-16e2-4239-8f39-0a5b0a03764f', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': 'fe342455-16e2-4239-8f39-0a5b0a03764f', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:56:09 GMT'}, 'RetryAttempts': 0}}
|[2020-02-06 15:56:14,761] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': '9023acf3-f74d-4e9e-ac4f-4ec4698f5aa9', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': '9023acf3-f74d-4e9e-ac4f-4ec4698f5aa9', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:56:15 GMT'}, 'RetryAttempts': 0}}
\[2020-02-06 15:56:19,974] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': '0a5a5741-a433-442c-bfc7-a420b37b2c79', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': '0a5a5741-a433-442c-bfc7-a420b37b2c79', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:56:20 GMT'}, 'RetryAttempts': 0}}
/[2020-02-06 15:56:25,186] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'EndpointStatus': 'Creating', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': 'fcc88350-594a-488c-90f5-ac44b2cffae2', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': 'fcc88350-594a-488c-90f5-ac44b2cffae2', 'content-type': 'application/x-amz-json-1.1', 'content-length': '308', 'date': 'Thu, 06 Feb 2020 23:56:25 GMT'}, 'RetryAttempts': 0}}
\[2020-02-06 15:56:30,424] DEBUG - AWS describe endpoint response: {'EndpointName': 'bobo-test-keras-mnist', 'EndpointArn': 'arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist', 'EndpointConfigName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'ProductionVariants': [{'VariantName': 'bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D', 'DeployedImages': [{'SpecifiedImage': '192023623294.dkr.ecr.us-west-2.amazonaws.com/kerasfashionmnistservice-sagemaker:20200206114430_94F93D', 'ResolvedImage': '192023623294.dkr.ecr.us-west-2.amazonaws.com/[email protected]:9313027c15fb774ab803258119860b91bb6d29c2be42cc4561c95db23d8aa728', 'ResolutionTime': datetime.datetime(2020, 2, 6, 15, 48, 5, 166000, tzinfo=tzlocal())}], 'CurrentWeight': 1.0, 'DesiredWeight': 1.0, 'CurrentInstanceCount': 1, 'DesiredInstanceCount': 1}], 'EndpointStatus': 'InService', 'CreationTime': datetime.datetime(2020, 2, 6, 15, 48, 2, 904000, tzinfo=tzlocal()), 'LastModifiedTime': datetime.datetime(2020, 2, 6, 15, 56, 23, 546000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': 'ea1725ce-b2f3-4727-b204-dd8b0e83aaab', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': 'ea1725ce-b2f3-4727-b204-dd8b0e83aaab', 'content-type': 'application/x-amz-json-1.1', 'content-length': '847', 'date': 'Thu, 06 Feb 2020 23:56:30 GMT'}, 'RetryAttempts': 0}}
Successfully created AWS Sagemaker deployment test-keras-mnist
{
  "namespace": "bobo",
  "name": "test-keras-mnist",
  "spec": {
    "bentoName": "KerasFashionMnistService",
    "bentoVersion": "20200206114430_94F93D",
    "operator": "AWS_SAGEMAKER",
    "sagemakerOperatorConfig": {
      "region": "us-west-2",
      "instanceType": "ml.m4.xlarge",
      "instanceCount": 1,
      "apiName": "predict"
    }
  },
  "state": {
    "state": "RUNNING",
    "infoJson": {
      "EndpointName": "bobo-test-keras-mnist",
      "EndpointArn": "arn:aws:sagemaker:us-west-2:192023623294:endpoint/bobo-test-keras-mnist",
      "EndpointConfigName": "bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D",
      "ProductionVariants": [
        {
          "VariantName": "bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D",
          "DeployedImages": [
            {
              "SpecifiedImage": "192023623294.dkr.ecr.us-west-2.amazonaws.com/kerasfashionmnistservice-sagemaker:20200206114430_94F93D",
              "ResolvedImage": "192023623294.dkr.ecr.us-west-2.amazonaws.com/[email protected]:9313027c15fb774ab803258119860b91bb6d29c2be42cc4561c95db23d8aa728",
              "ResolutionTime": "2020-02-06 15:48:05.166000-08:00"
            }
          ],
          "CurrentWeight": 1.0,
          "DesiredWeight": 1.0,
          "CurrentInstanceCount": 1,
          "DesiredInstanceCount": 1
        }
      ],
      "EndpointStatus": "InService",
      "CreationTime": "2020-02-06 15:48:02.904000-08:00",
      "LastModifiedTime": "2020-02-06 15:56:23.546000-08:00",
      "ResponseMetadata": {
        "RequestId": "ea1725ce-b2f3-4727-b204-dd8b0e83aaab",
        "HTTPStatusCode": 200,
        "HTTPHeaders": {
          "x-amzn-requestid": "ea1725ce-b2f3-4727-b204-dd8b0e83aaab",
          "content-type": "application/x-amz-json-1.1",
          "content-length": "847",
          "date": "Thu, 06 Feb 2020 23:56:30 GMT"
        },
        "RetryAttempts": 0
      }
    },
    "timestamp": "2020-02-06T23:56:30.425233Z"
  },
  "createdAt": "2020-02-06T23:47:57.351696Z",
  "lastUpdatedAt": "2020-02-06T23:47:57.351738Z"
}

Use bentoml sagemaker list to list all of the Sagemaker deployments

In [46]:
!bentoml sagemaker list
NAME              NAMESPACE    LABELS    PLATFORM       STATUS    AGE
test-keras-mnist  bobo                   aws-sagemaker  running   21 minutes and 33.68 seconds

Validating Sagemaker deployment result with sample data

In [47]:
!aws sagemaker-runtime invoke-endpoint --endpoint-name bobo-test-keras-mnist \
--body fileb:///Users/bozhaoyu/src/bento_gallery/keras/fashion-mnist/sample_image.png \
--content-type image/png output.json && cat output.json
{
    "ContentType": "application/json",
    "InvokedProductionVariant": "bobo-test-keras-m-KerasFashionMnistSer-20200206114430-94F93D"
}
"Ankle boot"

Deleting deployment is as easy as deploying it. With bentoml sagemaker delete it will delete the deployment along with related resources

In [48]:
!bentoml sagemaker delete test-keras-mnist
Successfully deleted AWS Sagemaker deployment "test-keras-mnist"