#!/usr/bin/env pythonimport argparseimport chainerimport chainer.functions as Fimport chainer.links as Limport chainerxfrom chainer import trainingfrom chainer.training import extensions# Network definitionclassMLP(chainer.Chain):def__init__(self,n_units,n_out):super(MLP, self).__init__()with self.init_scope():# the size of the inputs to each layer will be inferred self.l1 = L.Linear(None, n_units)# n_in -> n_units self.l2 = L.Linear(None, n_units)# n_units -> n_units self.l3 = L.Linear(None, n_out)# n_units -> n_outdefforward(self,x): h1 = F.relu(self.l1(x)) h2 = F.relu(self.l2(h1))return self.l3(h2)defmain(): parser = argparse.ArgumentParser(description="Chainer example: MNIST") parser.add_argument("--batchsize","-b", type=int, default=100, help="Number of images in each mini-batch", ) parser.add_argument("--epoch","-e", type=int, default=20, help="Number of sweeps over the dataset to train", ) parser.add_argument("--frequency", "-f", type=int, default=-1, help="Frequency of taking a snapshot" ) parser.add_argument("--device","-d", type=str, default="-1", help="Device specifier. Either ChainerX device ""specifier or an integer. If non-negative integer, ""CuPy arrays with specified device id are used. If ""negative integer, NumPy arrays are used", ) parser.add_argument("--out", "-o", default="result", help="Directory to output the result" ) parser.add_argument("--resume", "-r", type=str, help="Resume the training from snapshot" ) parser.add_argument("--unit", "-u", type=int, default=1000, help="Number of units") parser.add_argument("--noplot", dest="plot", action="store_false", help="Disable PlotReport extension", ) group = parser.add_argument_group("deprecated arguments") group.add_argument("--gpu","-g", dest="device", type=int, nargs="?", const=0, help="GPU ID (negative value indicates CPU)", ) args = parser.parse_args(args=[]) device = chainer.get_device(args.device)print("Device: {}".format(device))print("# unit: {}".format(args.unit))print("# Minibatch-size: {}".format(args.batchsize))print("# epoch: {}".format(args.epoch))print("")# Set up a neural network to train# Classifier reports softmax cross entropy loss and accuracy at every# iteration, which will be used by the PrintReport extension below. model = L.Classifier(MLP(args.unit, 10)) model.to_device(device) device.use()# Setup an optimizer optimizer = chainer.optimizers.Adam() optimizer.setup(model)# Load the MNIST dataset train, test = chainer.datasets.get_mnist() train_iter = chainer.iterators.SerialIterator(train, args.batchsize) test_iter = chainer.iterators.SerialIterator( test, args.batchsize, repeat=False, shuffle=False )# Set up a trainer updater = training.updaters.StandardUpdater(train_iter, optimizer, device=device) trainer = training.Trainer(updater, (args.epoch, "epoch"), out=args.out)# Evaluate the model with the test dataset for each epoch trainer.extend(extensions.Evaluator(test_iter, model, device=device))# Dump a computational graph from 'loss' variable at the first iteration# The "main" refers to the target link of the "main" optimizer.# TODO(niboshi): Temporarily disabled for chainerx. Fix it.if device.xp isnot chainerx: trainer.extend(extensions.DumpGraph("main/loss"))# Take a snapshot for each specified epoch frequency = args.epoch if args.frequency ==-1elsemax(1, args.frequency) trainer.extend(extensions.snapshot(), trigger=(frequency, "epoch"))# Write a log of evaluation statistics for each epoch trainer.extend(extensions.LogReport())# Save two plot images to the result dirif args.plot and extensions.PlotReport.available(): trainer.extend( extensions.PlotReport( ["main/loss", "validation/main/loss"], "epoch", file_name="loss.png" ) ) trainer.extend( extensions.PlotReport( ["main/accuracy", "validation/main/accuracy"],"epoch", file_name="accuracy.png", ) )# Print selected entries of the log to stdout# Here "main" refers to the target link of the "main" optimizer again, and# "validation" refers to the default name of the Evaluator extension.# Entries other than 'epoch' are reported by the Classifier link, called by# either the updater or the evaluator. trainer.extend( extensions.PrintReport( ["epoch","main/loss","validation/main/loss","main/accuracy","validation/main/accuracy","elapsed_time", ] ) )# Print a progress bar to stdout trainer.extend(extensions.ProgressBar())if args.resume isnotNone:# Resume from a snapshot chainer.serializers.load_npz(args.resume, trainer)# Run the training trainer.run()if__name__=="__main__":main()
Wrap model using s2i
Send some random features that conform to the contract
---> Installing application source...
---> Installing dependencies ...
Looking in links: /whl
Collecting chainer==6.2.0 (from -r requirements.txt (line 1))
WARNING: Url '/whl' is ignored. It is either a non-existing path or lacks a specific scheme.
Downloading https://files.pythonhosted.org/packages/2c/5a/86c50a0119a560a39d782c4cdd9b72927c090cc2e3f70336e01b19a5f97a/chainer-6.2.0.tar.gz (873kB)
Requirement already satisfied: setuptools in /usr/local/lib/python3.6/site-packages (from chainer==6.2.0->-r requirements.txt (line 1)) (41.0.1)
Collecting typing<=3.6.6 (from chainer==6.2.0->-r requirements.txt (line 1))
WARNING: Url '/whl' is ignored. It is either a non-existing path or lacks a specific scheme.
Downloading https://files.pythonhosted.org/packages/4a/bd/eee1157fc2d8514970b345d69cb9975dcd1e42cd7e61146ed841f6e68309/typing-3.6.6-py3-none-any.whl
Collecting typing_extensions<=3.6.6 (from chainer==6.2.0->-r requirements.txt (line 1))
WARNING: Url '/whl' is ignored. It is either a non-existing path or lacks a specific scheme.
Downloading https://files.pythonhosted.org/packages/62/4f/392a1fa2873e646f5990eb6f956e662d8a235ab474450c72487745f67276/typing_extensions-3.6.6-py3-none-any.whl
Collecting filelock (from chainer==6.2.0->-r requirements.txt (line 1))
WARNING: Url '/whl' is ignored. It is either a non-existing path or lacks a specific scheme.
Downloading https://files.pythonhosted.org/packages/93/83/71a2ee6158bb9f39a90c0dea1637f81d5eef866e188e1971a1b1ab01a35a/filelock-3.0.12-py3-none-any.whl
Requirement already satisfied: numpy>=1.9.0 in /usr/local/lib/python3.6/site-packages (from chainer==6.2.0->-r requirements.txt (line 1)) (1.16.4)
Collecting protobuf<3.8.0rc1,>=3.0.0 (from chainer==6.2.0->-r requirements.txt (line 1))
WARNING: Url '/whl' is ignored. It is either a non-existing path or lacks a specific scheme.
Downloading https://files.pythonhosted.org/packages/5a/aa/a858df367b464f5e9452e1c538aa47754d467023850c00b000287750fa77/protobuf-3.7.1-cp36-cp36m-manylinux1_x86_64.whl (1.2MB)
Requirement already satisfied: six>=1.9.0 in /usr/local/lib/python3.6/site-packages (from chainer==6.2.0->-r requirements.txt (line 1)) (1.12.0)
Building wheels for collected packages: chainer
Building wheel for chainer (setup.py): started
Building wheel for chainer (setup.py): finished with status 'done'
Stored in directory: /root/.cache/pip/wheels/2e/be/c5/6ee506abcaa4a53106f7d7671bbee8b4e5243bc562a9d32ad1
Successfully built chainer
Installing collected packages: typing, typing-extensions, filelock, protobuf, chainer
Found existing installation: protobuf 3.8.0
Uninstalling protobuf-3.8.0:
Successfully uninstalled protobuf-3.8.0
Successfully installed chainer-6.2.0 filelock-3.0.12 protobuf-3.7.1 typing-3.6.6 typing-extensions-3.6.6
WARNING: Url '/whl' is ignored. It is either a non-existing path or lacks a specific scheme.
WARNING: You are using pip version 19.1, however version 19.2.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Build completed successfully
!docker run --name "mnist_predictor" -d --rm -p 5000:5000 chainer-mnist:0.1
/Users/dtaniwaki/.pyenv/versions/3.7.4/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)])
/Users/dtaniwaki/.pyenv/versions/3.7.4/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)])
/Users/dtaniwaki/.pyenv/versions/3.7.4/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)])
/Users/dtaniwaki/.pyenv/versions/3.7.4/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)])
/Users/dtaniwaki/.pyenv/versions/3.7.4/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)])
/Users/dtaniwaki/.pyenv/versions/3.7.4/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)])
/Users/dtaniwaki/.pyenv/versions/3.7.4/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)])
/Users/dtaniwaki/.pyenv/versions/3.7.4/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)])
/Users/dtaniwaki/.pyenv/versions/3.7.4/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)])
/Users/dtaniwaki/.pyenv/versions/3.7.4/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)])
/Users/dtaniwaki/.pyenv/versions/3.7.4/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)])
/Users/dtaniwaki/.pyenv/versions/3.7.4/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)])
----------------------------------------
SENDING NEW REQUEST:
[[0.997 0.039 0.778 0.59 0.526 0.591 0.659 0.423 0.404 0.302 0.322 0.453
0.54 0.852 0.268 0.564 0.163 0.032 0.934 0.317 0.395 0.122 0.056 0.729
0.106 0.443 0.334 0.784 0.646 0.296 0.524 0.855 0.503 0.727 0.326 0.491
0.385 0.042 0.82 0.715 0.972 0.699 0.431 0.618 0.096 0.849 0.224 0.187
0.145 0.357 0.187 0.779 0.009 0.775 0.775 0.584 0.897 0.674 0.01 0.775
0.095 0.081 0.089 0.351 0.985 0.878 0.906 0.396 0.499 0.646 0.127 0.966
0.087 0.668 0.314 0.853 0.55 0.345 0.95 0.792 0.797 0.037 0.18 0.592
0.941 0.662 0.101 0.388 0.902 0.868 0.505 0.824 0.8 0.855 0.568 0.368
0.605 0.224 0.214 0.582 0.365 0.44 0.389 0.922 0.028 0.142 0.525 0.843
0.706 0.61 0.215 0.962 0.334 0.273 0.365 0.075 0.929 0.693 0.382 0.76
0.75 0.403 0.344 0.218 0.831 0.431 0.469 0.527 0.755 0.048 0.407 0.953
0.468 0.186 0.589 0.839 0.513 0.307 0.251 0.738 0.173 0.185 0.499 0.797
0.264 0.149 0.547 0.699 0.935 0.071 0.145 0.853 0.884 0.195 0.944 0.775
0.523 0.627 0.729 0.826 0.894 0.117 0.935 0.363 0.03 0.16 0.435 0.579
0.954 0.487 0.133 0.348 0.12 0.741 0.203 0.103 0.334 0.009 0.898 0.597
0.375 0.241 0.27 0.094 0.819 0.737 0.147 0.715 0.138 0.801 0.427 0.602
0.336 0.796 0.691 0.415 0.329 0.155 0.17 0.152 0.237 0.957 0.298 0.837
0.982 0.805 0.972 0.125 0.916 0.101 0.054 0.347 0.566 0.232 0.885 0.864
0.049 0.205 0.361 0.767 0.099 0.634 0.359 0.975 0.56 0.289 0.49 0.359
0.901 0.39 0.197 0.985 0.141 0.232 0.336 0.932 0.923 0.032 0.126 0.51
0.571 0.743 0.831 0.999 0.972 0.649 0.527 0.909 0.071 0.539 0.676 0.851
0.104 0.103 0.392 0.641 0.838 0.333 0.453 0.573 0.199 0.924 0.588 0.955
0.866 0.085 0.985 0.803 0.386 0.713 0.056 0.972 0.489 0.623 0.108 0.904
0.746 0.986 0.824 0.996 0.161 0.738 0.24 0.153 0.935 0.782 0.393 0.098
0.449 0.24 0.621 0.293 0.569 0.196 0.893 0.605 0.608 0.114 0.383 0.038
0.573 0.373 0.474 0.006 0.292 0.738 0.943 0.65 0.553 0.684 0.3 0.587
0.183 0.521 0.211 0.074 0.696 0.672 0.206 0.694 0.129 0.81 0.415 0.56
0.994 0.686 0.807 0.514 0.215 0.096 0.295 0.233 0.625 0.663 0.794 0.16
0.837 0.194 0.07 0.939 0.965 0.142 0.66 0.152 0.249 0.995 0.892 0.265
0.865 0.742 0.19 0.03 0.42 0.807 0.15 0.163 0.529 0.23 0.59 0.676
0.121 0.474 0.329 0.383 0.534 0.093 0.861 0.058 0.019 0.212 0.296 0.947
0.879 0.445 0.357 0.021 0.551 0.362 0.653 0.258 0.146 0.453 0.373 0.448
0.339 0.974 0.266 0.656 0.036 0.698 0.651 0.91 0.438 0.767 0.716 0.267
0.871 0.781 0.13 0.912 0.13 0.332 0.647 0.31 0.171 0.323 0.703 0.197
0.918 0.803 0.43 0.103 0.606 0.955 0.733 0.902 0.139 0.471 0.994 0.393
0.95 0.485 0.782 0.213 0.994 0.206 0.938 0.019 0.429 0.135 0.811 0.209
0.991 0.93 0.878 0.742 0.859 0.397 0.128 0.087 0.447 0.392 0.61 0.18
0.087 0.641 0.31 0.033 0.211 0.431 0.051 0.639 0.461 0.466 0.171 0.736
0.727 0.183 0.542 0.416 0.524 0.251 0.513 0.087 0.395 0.164 0.25 0.384
0.705 0.683 0.827 0.188 0.163 0.325 0.256 0.904 0.161 0.334 0.639 0.728
0.267 0.463 0.373 0.111 0.585 0.794 0.972 0.281 0.984 0.564 0.671 0.868
0.741 0.638 0.702 0.778 0.667 0.372 0.818 0.49 0.102 0.403 0.187 0.283
0.492 0.937 0.643 0.657 0.514 0.492 0.042 0.809 0.088 0.018 0.631 0.731
0.516 0.625 0.597 0.629 0.798 0.907 0.861 0.439 0.777 0.014 0.771 0.152
0.16 0.997 0.699 0.127 0.038 0.503 0.572 0.878 0.901 0.215 0.606 0.686
0.847 0.007 0.976 0.895 0.357 0.374 0.989 0.544 0.317 0.043 0.718 0.788
0.121 0.432 0.16 0.485 0.553 0.048 0.003 0.375 0.592 0.207 0.853 0.81
0.043 0.554 0.084 0.584 0.73 0.766 0.738 0.038 0.56 0.475 0.763 0.002
0.382 0.49 0.302 0.873 0.141 0.023 0.341 0.113 0.197 0.948 0.088 0.294
0.778 0.807 0.935 0.712 0.466 0.885 0.815 0.843 0.745 0.217 0.664 0.142
0.421 0.371 0.536 0.009 0.036 0.352 0.916 0.161 0.345 0.348 0.688 0.806
0.434 0.413 0.567 0.043 0.934 0.072 0.54 0.347 0.817 0.321 0.85 0.478
0.832 0.899 0.283 0.34 0.304 0.955 0.915 0.934 0.452 0.423 0.75 0.013
0.5 0.691 0.854 0.453 0.959 0.843 0.698 0.756 0.918 0.992 0.663 0.608
0.756 0.7 0.347 0.427 0.198 0.37 0.837 0.362 0.291 0.126 0.695 0.777
0.318 0.88 0.859 0.958 0.075 0.332 0.321 0.179 0.834 0.027 0.332 0.799
0.504 0.274 0.819 0.081 0.337 0.02 0.598 0.727 0.159 0.937 0.199 0.639
0.063 0.75 0.637 0.686 0.677 0.102 0.135 0.264 0.091 0.837 0.562 0.453
0.503 0.884 0.147 0.966 0.118 0.293 0.327 0.859 0.958 0.498 0.369 0.123
0.354 0.812 0.163 0.96 0.64 0.596 0.029 0.84 0.159 0.717 0.025 0.394
0.185 0.29 0.554 0.646 0.432 0.197 0.668 0.531 0.206 0.599 0.842 0.579
0.836 0.889 0.797 0.891 0.1 0.087 0.825 0.952 0.781 0.295 0.819 0.038
0.34 0.476 0.08 0.784 0.556 0.282 0.699 0.954 0.5 0.332 0.213 0.618
0.92 0.776 0.147 0.749 0.597 0.191 0.957 0.47 0.324 0.352 0.837 0.263
0.536 0.48 0.997 0.417 0.08 0.464 0.886 0.019 0.307 0.164 0.36 0.638
0.46 0.803 0.139 0.575]]
Traceback (most recent call last):
File "/Users/dtaniwaki/.pyenv/versions/3.7.4/lib/python3.7/site-packages/urllib3/connection.py", line 160, in _new_conn
(self._dns_host, self.port), self.timeout, **extra_kw)
File "/Users/dtaniwaki/.pyenv/versions/3.7.4/lib/python3.7/site-packages/urllib3/util/connection.py", line 80, in create_connection
raise err
File "/Users/dtaniwaki/.pyenv/versions/3.7.4/lib/python3.7/site-packages/urllib3/util/connection.py", line 70, in create_connection
sock.connect(sa)
ConnectionRefusedError: [Errno 61] Connection refused
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/dtaniwaki/.pyenv/versions/3.7.4/lib/python3.7/site-packages/urllib3/connectionpool.py", line 603, in urlopen
chunked=chunked)
File "/Users/dtaniwaki/.pyenv/versions/3.7.4/lib/python3.7/site-packages/urllib3/connectionpool.py", line 355, in _make_request
conn.request(method, url, **httplib_request_kw)
File "/Users/dtaniwaki/.pyenv/versions/3.7.4/lib/python3.7/http/client.py", line 1244, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/Users/dtaniwaki/.pyenv/versions/3.7.4/lib/python3.7/http/client.py", line 1290, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/Users/dtaniwaki/.pyenv/versions/3.7.4/lib/python3.7/http/client.py", line 1239, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/Users/dtaniwaki/.pyenv/versions/3.7.4/lib/python3.7/http/client.py", line 1026, in _send_output
self.send(msg)
File "/Users/dtaniwaki/.pyenv/versions/3.7.4/lib/python3.7/http/client.py", line 966, in send
self.connect()
File "/Users/dtaniwaki/.pyenv/versions/3.7.4/lib/python3.7/site-packages/urllib3/connection.py", line 183, in connect
conn = self._new_conn()
File "/Users/dtaniwaki/.pyenv/versions/3.7.4/lib/python3.7/site-packages/urllib3/connection.py", line 169, in _new_conn
self, "Failed to establish a new connection: %s" % e)
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x1232a2050>: Failed to establish a new connection: [Errno 61] Connection refused
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/dtaniwaki/.pyenv/versions/3.7.4/lib/python3.7/site-packages/requests/adapters.py", line 449, in send
timeout=timeout
File "/Users/dtaniwaki/.pyenv/versions/3.7.4/lib/python3.7/site-packages/urllib3/connectionpool.py", line 641, in urlopen
_stacktrace=sys.exc_info()[2])
File "/Users/dtaniwaki/.pyenv/versions/3.7.4/lib/python3.7/site-packages/urllib3/util/retry.py", line 399, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='0.0.0.0', port=5000): Max retries exceeded with url: /predict (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x1232a2050>: Failed to establish a new connection: [Errno 61] Connection refused'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/dtaniwaki/.pyenv/versions/3.7.4/bin/seldon-core-tester", line 10, in <module>
sys.exit(main())
File "/Users/dtaniwaki/.pyenv/versions/3.7.4/lib/python3.7/site-packages/seldon_core/microservice_tester.py", line 258, in main
run_predict(args)
File "/Users/dtaniwaki/.pyenv/versions/3.7.4/lib/python3.7/site-packages/seldon_core/microservice_tester.py", line 225, in run_predict
response = sc.microservice(data=batch, transport=transport, method="predict", payload_type=payload_type, names=feature_names)
File "/Users/dtaniwaki/.pyenv/versions/3.7.4/lib/python3.7/site-packages/seldon_core/seldon_client.py", line 395, in microservice
return microservice_api_rest_seldon_message(**k)
File "/Users/dtaniwaki/.pyenv/versions/3.7.4/lib/python3.7/site-packages/seldon_core/seldon_client.py", line 534, in microservice_api_rest_seldon_message
data={"json": json.dumps(payload)})
File "/Users/dtaniwaki/.pyenv/versions/3.7.4/lib/python3.7/site-packages/requests/api.py", line 116, in post
return request('post', url, data=data, json=json, **kwargs)
File "/Users/dtaniwaki/.pyenv/versions/3.7.4/lib/python3.7/site-packages/requests/api.py", line 60, in request
return session.request(method=method, url=url, **kwargs)
File "/Users/dtaniwaki/.pyenv/versions/3.7.4/lib/python3.7/site-packages/requests/sessions.py", line 533, in request
resp = self.send(prep, **send_kwargs)
File "/Users/dtaniwaki/.pyenv/versions/3.7.4/lib/python3.7/site-packages/requests/sessions.py", line 646, in send
r = adapter.send(request, **kwargs)
File "/Users/dtaniwaki/.pyenv/versions/3.7.4/lib/python3.7/site-packages/requests/adapters.py", line 516, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='0.0.0.0', port=5000): Max retries exceeded with url: /predict (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x1232a2050>: Failed to establish a new connection: [Errno 61] Connection refused'))
!docker rm mnist_predictor --force
Error: No such container: mnist_predictor
!minikube start --memory 4096
😄 minikube v1.2.0 on darwin (amd64)
🔥 Creating virtualbox VM (CPUs=2, Memory=4096MB, Disk=20000MB) ...
🐳 Configuring environment for Kubernetes v1.15.0 on Docker 18.09.6
🚜 Pulling images ...
🚀 Launching Kubernetes ...
⌛ Verifying: apiserver proxy etcd scheduler controller dns
🏄 Done! kubectl is now configured to use "minikube"
---> Installing application source...
---> Installing dependencies ...
Looking in links: /whl
Collecting chainer==6.2.0 (from -r requirements.txt (line 1))
WARNING: Url '/whl' is ignored. It is either a non-existing path or lacks a specific scheme.
Downloading https://files.pythonhosted.org/packages/2c/5a/86c50a0119a560a39d782c4cdd9b72927c090cc2e3f70336e01b19a5f97a/chainer-6.2.0.tar.gz (873kB)
Requirement already satisfied: setuptools in /usr/local/lib/python3.6/site-packages (from chainer==6.2.0->-r requirements.txt (line 1)) (41.0.1)
Collecting typing<=3.6.6 (from chainer==6.2.0->-r requirements.txt (line 1))
WARNING: Url '/whl' is ignored. It is either a non-existing path or lacks a specific scheme.
Downloading https://files.pythonhosted.org/packages/4a/bd/eee1157fc2d8514970b345d69cb9975dcd1e42cd7e61146ed841f6e68309/typing-3.6.6-py3-none-any.whl
Collecting typing_extensions<=3.6.6 (from chainer==6.2.0->-r requirements.txt (line 1))
WARNING: Url '/whl' is ignored. It is either a non-existing path or lacks a specific scheme.
Downloading https://files.pythonhosted.org/packages/62/4f/392a1fa2873e646f5990eb6f956e662d8a235ab474450c72487745f67276/typing_extensions-3.6.6-py3-none-any.whl
Collecting filelock (from chainer==6.2.0->-r requirements.txt (line 1))
WARNING: Url '/whl' is ignored. It is either a non-existing path or lacks a specific scheme.
Downloading https://files.pythonhosted.org/packages/93/83/71a2ee6158bb9f39a90c0dea1637f81d5eef866e188e1971a1b1ab01a35a/filelock-3.0.12-py3-none-any.whl
Requirement already satisfied: numpy>=1.9.0 in /usr/local/lib/python3.6/site-packages (from chainer==6.2.0->-r requirements.txt (line 1)) (1.16.4)
Collecting protobuf<3.8.0rc1,>=3.0.0 (from chainer==6.2.0->-r requirements.txt (line 1))
WARNING: Url '/whl' is ignored. It is either a non-existing path or lacks a specific scheme.
Downloading https://files.pythonhosted.org/packages/5a/aa/a858df367b464f5e9452e1c538aa47754d467023850c00b000287750fa77/protobuf-3.7.1-cp36-cp36m-manylinux1_x86_64.whl (1.2MB)
Requirement already satisfied: six>=1.9.0 in /usr/local/lib/python3.6/site-packages (from chainer==6.2.0->-r requirements.txt (line 1)) (1.12.0)
Building wheels for collected packages: chainer
Building wheel for chainer (setup.py): started
Building wheel for chainer (setup.py): finished with status 'done'
Stored in directory: /root/.cache/pip/wheels/2e/be/c5/6ee506abcaa4a53106f7d7671bbee8b4e5243bc562a9d32ad1
Successfully built chainer
Installing collected packages: typing, typing-extensions, filelock, protobuf, chainer
Found existing installation: protobuf 3.8.0
Uninstalling protobuf-3.8.0:
Successfully uninstalled protobuf-3.8.0
Successfully installed chainer-6.2.0 filelock-3.0.12 protobuf-3.7.1 typing-3.6.6 typing-extensions-3.6.6
WARNING: Url '/whl' is ignored. It is either a non-existing path or lacks a specific scheme.
WARNING: You are using pip version 19.1, however version 19.2.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Build completed successfully
!kubectl create -f chainer_mnist_deployment.json
seldondeployment.machinelearning.seldon.io/seldon-deployment-example created
!kubectl rollout status deploy/chainer-mnist-deployment-chainer-mnist-predictor-76478b2
Waiting for deployment "chainer-mnist-deployment-chainer-mnist-predictor-76478b2" rollout to finish: 0 of 1 updated replicas are available...
deployment "chainer-mnist-deployment-chainer-mnist-predictor-76478b2" successfully rolled out