Tensorflow & Keras - Build from Source

Tensorflow is always problematic, particularly, for guys like me...

1. Configuration

Linux Kernel 4.17.3 + Ubuntu 18.04 + GCC 7.3.0 + Python

1
2
$ uname -r
4.17.3-041703-generic
1
2
3
4
5
6
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04 LTS
Release: 18.04
Codename: bionic
1
2
3
4
5
$ gcc --version
gcc (Ubuntu 7.3.0-16ubuntu3) 7.3.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
1
2
$ python --version
Python 3.6.5

2. Install Bazel

From Bazel's official website Installing Bazel on Ubuntu:

1
2
3
$ echo "deb [arch=amd64] http://storage.googleapis.com/bazel-apt stable jdk1.8" | sudo tee /etc/apt/sources.list.d/bazel.list
$ curl https://bazel.build/bazel-release.pub.gpg | sudo apt-key add -
$ sudo apt update && sudo apt install bazel

Current bazel 0.15.0 will be installed.

3. Let's Build Tensorflow from Source

3.1 Configuration

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
$ ./configure
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.protobuf.UnsafeUtil (file:~/.cache/bazel/_bazel_jiapei/install/ce085f519b017357185750fe457b4648/_embedded_binaries/A-server.jar) to field java.nio.Buffer.address
WARNING: Please consider reporting this to the maintainers of com.google.protobuf.UnsafeUtil
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
WARNING: --batch mode is deprecated. Please instead explicitly shut down your Bazel server using the command "bazel shutdown".
You have bazel 0.15.0 installed.
Please specify the location of python. [Default is /usr/bin/python]:


Found possible Python library paths:
/usr/local/lib/python3.6/dist-packages
/usr/lib/python3/dist-packages
Please input the desired Python library path to use. Default is [/usr/local/lib/python3.6/dist-packages]

Do you wish to build TensorFlow with jemalloc as malloc support? [Y/n]: Y
jemalloc as malloc support will be enabled for TensorFlow.

Do you wish to build TensorFlow with Google Cloud Platform support? [Y/n]: Y
Google Cloud Platform support will be enabled for TensorFlow.

Do you wish to build TensorFlow with Hadoop File System support? [Y/n]: Y
Hadoop File System support will be enabled for TensorFlow.

Do you wish to build TensorFlow with Amazon AWS Platform support? [Y/n]: Y
Amazon AWS Platform support will be enabled for TensorFlow.

Do you wish to build TensorFlow with Apache Kafka Platform support? [Y/n]: Y
Apache Kafka Platform support will be enabled for TensorFlow.

Do you wish to build TensorFlow with XLA JIT support? [y/N]: N
No XLA JIT support will be enabled for TensorFlow.

Do you wish to build TensorFlow with GDR support? [y/N]: N
No GDR support will be enabled for TensorFlow.

Do you wish to build TensorFlow with VERBS support? [y/N]: N
No VERBS support will be enabled for TensorFlow.

Do you wish to build TensorFlow with OpenCL SYCL support? [y/N]: N
No OpenCL SYCL support will be enabled for TensorFlow.

Do you wish to build TensorFlow with CUDA support? [y/N]: y
CUDA support will be enabled for TensorFlow.

Please specify the CUDA SDK version you want to use. [Leave empty to default to CUDA 9.0]: 9.2


Please specify the location where CUDA 9.2 toolkit is installed. Refer to README.md for more details. [Default is /usr/local/cuda]:


Please specify the cuDNN version you want to use. [Leave empty to default to cuDNN 7.0]: 7.1.4


Please specify the location where cuDNN 7 library is installed. Refer to README.md for more details. [Default is /usr/local/cuda]:


Do you wish to build TensorFlow with TensorRT support? [y/N]: N
No TensorRT support will be enabled for TensorFlow.

Please specify the NCCL version you want to use. [Leave empty to default to NCCL 1.3]:


Please specify a list of comma-separated Cuda compute capabilities you want to build with.
You can find the compute capability of your device at: https://developer.nvidia.com/cuda-gpus.
Please note that each additional compute capability significantly increases your build time and binary size. [Default is: 5.2]


Do you want to use clang as CUDA compiler? [y/N]: N
nvcc will be used as CUDA compiler.

Please specify which gcc should be used by nvcc as the host compiler. [Default is /usr/bin/gcc]:


Do you wish to build TensorFlow with MPI support? [y/N]: N
No MPI support will be enabled for TensorFlow.

Please specify optimization flags to use during compilation when bazel option "--config=opt" is specified [Default is -march=native]:


Would you like to interactively configure ./WORKSPACE for Android builds? [y/N]: N
Not configuring the WORKSPACE for Android builds.

Preconfigured Bazel build configs. You can use any of the below by adding "--config=<>" to your build command. See tools/bazel.rc for more details.
--config=mkl # Build with MKL support.
--config=monolithic # Config for mostly static monolithic build.
Configuration finished

3.2 FIRST Bazel Build

Follow Installing TensorFlow from Sources on Tensorflow's official website, have all required packages prepared, and run:

1
bazel build --config=opt --config=cuda //tensorflow/tools/pip_package:build_pip_package

you will meet several ERROR messages, which requires you to carry out the following modifications.

3.3 Modifications

  • File **~/.cache/bazel/_bazel_jiapei/051cd94cedc722db8c69e42ce51064b5/external/jpeg/BUILD**:
1
2
3
4
5
config_setting(
name = "armeabi-v7a",
- values = {"android_cpu": "armeabi-v7a"},
+ values = {"cpu": "armeabi-v7a"},
)
  • Two Symbolic links
1
2
$ sudo ln -s /usr/local/cuda/include/crt/math_functions.hpp /usr/local/cuda/include/math_functions.hpp
$ sudo ln -s /usr/local/cuda/nvvm/libdevice/libdevice.10.bc /usr/local/cuda/nvvm/lib64/libdevice.10.bc

3.4 Bazel Build Again

1
bazel build --config=opt --config=cuda //tensorflow/tools/pip_package:build_pip_package

It'll take around 30 minutes to have Tensorflow successfully built.

1
2
3
4
5
6
......
Target //tensorflow/tools/pip_package:build_pip_package up-to-date:
bazel-bin/tensorflow/tools/pip_package/build_pip_package
INFO: Elapsed time: 4924.451s, Critical Path: 197.91s
INFO: 8864 processes: 8864 local.
INFO: Build completed successfully, 11002 total actions

4. Tensorflow Installation

4.1 Build the pip File

1
2
3
4
5
6
7
8
9
10
11
12
13
$ bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg
Wed Jul 11 00:09:09 PDT 2018 : === Preparing sources in dir: /tmp/tmp.5X0zsqfxYo
/media/jiapei/Data/Downloads/machinelearning/deeplearning/tensorflow/tensorflow /media/jiapei/Data/Downloads/machinelearning/deeplearning/tensorflow/tensorflow
/media/jiapei/Data/Downloads/machinelearning/deeplearning/tensorflow/tensorflow
Wed Jul 11 00:09:35 PDT 2018 : === Building wheel
warning: no files found matching '*.dll' under directory '*'
warning: no files found matching '*.lib' under directory '*'
warning: no files found matching '*.h' under directory 'tensorflow/include/tensorflow'
warning: no files found matching '*' under directory 'tensorflow/include/Eigen'
warning: no files found matching '*.h' under directory 'tensorflow/include/google'
warning: no files found matching '*' under directory 'tensorflow/include/third_party'
warning: no files found matching '*' under directory 'tensorflow/include/unsupported'
Wed Jul 11 00:10:58 PDT 2018 : === Output wheel file is in: /tmp/tensorflow_pkg

Let's have a look at what's been built:

1
2
$ ls /tmp/tensorflow_pkg/
tensorflow-1.9.0rc0-cp36-cp36m-linux_x86_64.whl

4.2 Pip Installation

And, let's have tensorflow-1.9.0rc0-cp36-cp36m-linux_x86_64.whl installed.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
$ pip3 install /tmp/tensorflow_pkg/tensorflow-1.9.0rc0-cp36-cp36m-linux_x86_64.whl
Processing /tmp/tensorflow_pkg/tensorflow-1.9.0rc0-cp36-cp36m-linux_x86_64.whl
Requirement already satisfied: wheel>=0.26 in /usr/local/lib/python3.6/dist-packages (from tensorflow==1.9.0rc0) (0.31.1)
Requirement already satisfied: gast>=0.2.0 in /usr/local/lib/python3.6/dist-packages (from tensorflow==1.9.0rc0) (0.2.0)
Requirement already satisfied: numpy>=1.13.3 in /usr/local/lib/python3.6/dist-packages (from tensorflow==1.9.0rc0) (1.14.5)
Requirement already satisfied: astor>=0.6.0 in /usr/local/lib/python3.6/dist-packages (from tensorflow==1.9.0rc0) (0.7.1)
Requirement already satisfied: six>=1.10.0 in ./.local/lib/python3.6/site-packages (from tensorflow==1.9.0rc0) (1.11.0)
Requirement already satisfied: grpcio>=1.8.6 in /usr/local/lib/python3.6/dist-packages (from tensorflow==1.9.0rc0) (1.13.0)
Requirement already satisfied: absl-py>=0.1.6 in /usr/local/lib/python3.6/dist-packages (from tensorflow==1.9.0rc0) (0.2.2)
Requirement already satisfied: tensorboard<1.9.0,>=1.8.0 in /usr/local/lib/python3.6/dist-packages (from tensorflow==1.9.0rc0) (1.8.0)
Requirement already satisfied: termcolor>=1.1.0 in /usr/local/lib/python3.6/dist-packages (from tensorflow==1.9.0rc0) (1.1.0)
Requirement already satisfied: setuptools<=39.1.0 in /usr/local/lib/python3.6/dist-packages (from tensorflow==1.9.0rc0) (39.1.0)
Requirement already satisfied: protobuf>=3.6.0 in /usr/local/lib/python3.6/dist-packages (from tensorflow==1.9.0rc0) (3.6.0)
Requirement already satisfied: bleach==1.5.0 in /usr/local/lib/python3.6/dist-packages (from tensorboard<1.9.0,>=1.8.0->tensorflow==1.9.0rc0) (1.5.0)
Requirement already satisfied: html5lib==0.9999999 in /usr/local/lib/python3.6/dist-packages (from tensorboard<1.9.0,>=1.8.0->tensorflow==1.9.0rc0) (0.9999999)
Requirement already satisfied: werkzeug>=0.11.10 in ./.local/lib/python3.6/site-packages (from tensorboard<1.9.0,>=1.8.0->tensorflow==1.9.0rc0) (0.14.1)
Requirement already satisfied: markdown>=2.6.8 in /usr/local/lib/python3.6/dist-packages (from tensorboard<1.9.0,>=1.8.0->tensorflow==1.9.0rc0) (2.6.11)
Successfully installed tensorflow-1.9.0rc0

Let's test if Tensorflow has been successfully installed.

4.3 Check Tensorflow

1
2
3
4
5
6
7
$ python
Python 3.6.5 (default, Apr 1 2018, 05:46:30)
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
>>> tf.__version__
'1.9.0-rc0'

5. Keras Installation

After successfully check out Keras, we can easily have Keras installed by command python setup.py install.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
$ python setup.py install
running install
running bdist_egg
running egg_info
creating Keras.egg-info
writing Keras.egg-info/PKG-INFO
writing dependency_links to Keras.egg-info/dependency_links.txt
writing requirements to Keras.egg-info/requires.txt
writing top-level names to Keras.egg-info/top_level.txt
writing manifest file 'Keras.egg-info/SOURCES.txt'
reading manifest file 'Keras.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'Keras.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
creating build
creating build/lib
creating build/lib/docs
copying docs/autogen.py -> build/lib/docs
copying docs/__init__.py -> build/lib/docs
creating build/lib/keras
copying keras/activations.py -> build/lib/keras
copying keras/callbacks.py -> build/lib/keras
copying keras/constraints.py -> build/lib/keras
copying keras/initializers.py -> build/lib/keras
copying keras/losses.py -> build/lib/keras
copying keras/metrics.py -> build/lib/keras
copying keras/models.py -> build/lib/keras
copying keras/objectives.py -> build/lib/keras
copying keras/optimizers.py -> build/lib/keras
copying keras/regularizers.py -> build/lib/keras
copying keras/__init__.py -> build/lib/keras
creating build/lib/keras/applications
copying keras/applications/densenet.py -> build/lib/keras/applications
copying keras/applications/imagenet_utils.py -> build/lib/keras/applications
copying keras/applications/inception_resnet_v2.py -> build/lib/keras/applications
copying keras/applications/inception_v3.py -> build/lib/keras/applications
copying keras/applications/mobilenet.py -> build/lib/keras/applications
copying keras/applications/mobilenetv2.py -> build/lib/keras/applications
copying keras/applications/nasnet.py -> build/lib/keras/applications
copying keras/applications/resnet50.py -> build/lib/keras/applications
copying keras/applications/vgg16.py -> build/lib/keras/applications
copying keras/applications/vgg19.py -> build/lib/keras/applications
copying keras/applications/xception.py -> build/lib/keras/applications
copying keras/applications/__init__.py -> build/lib/keras/applications
creating build/lib/keras/backend
copying keras/backend/cntk_backend.py -> build/lib/keras/backend
copying keras/backend/common.py -> build/lib/keras/backend
copying keras/backend/tensorflow_backend.py -> build/lib/keras/backend
copying keras/backend/theano_backend.py -> build/lib/keras/backend
copying keras/backend/__init__.py -> build/lib/keras/backend
creating build/lib/keras/datasets
copying keras/datasets/boston_housing.py -> build/lib/keras/datasets
copying keras/datasets/cifar.py -> build/lib/keras/datasets
copying keras/datasets/cifar10.py -> build/lib/keras/datasets
copying keras/datasets/cifar100.py -> build/lib/keras/datasets
copying keras/datasets/fashion_mnist.py -> build/lib/keras/datasets
copying keras/datasets/imdb.py -> build/lib/keras/datasets
copying keras/datasets/mnist.py -> build/lib/keras/datasets
copying keras/datasets/reuters.py -> build/lib/keras/datasets
copying keras/datasets/__init__.py -> build/lib/keras/datasets
creating build/lib/keras/engine
copying keras/engine/base_layer.py -> build/lib/keras/engine
copying keras/engine/input_layer.py -> build/lib/keras/engine
copying keras/engine/network.py -> build/lib/keras/engine
copying keras/engine/saving.py -> build/lib/keras/engine
copying keras/engine/sequential.py -> build/lib/keras/engine
copying keras/engine/topology.py -> build/lib/keras/engine
copying keras/engine/training.py -> build/lib/keras/engine
copying keras/engine/training_arrays.py -> build/lib/keras/engine
copying keras/engine/training_generator.py -> build/lib/keras/engine
copying keras/engine/training_utils.py -> build/lib/keras/engine
copying keras/engine/__init__.py -> build/lib/keras/engine
creating build/lib/keras/layers
copying keras/layers/advanced_activations.py -> build/lib/keras/layers
copying keras/layers/convolutional.py -> build/lib/keras/layers
copying keras/layers/convolutional_recurrent.py -> build/lib/keras/layers
copying keras/layers/core.py -> build/lib/keras/layers
copying keras/layers/cudnn_recurrent.py -> build/lib/keras/layers
copying keras/layers/embeddings.py -> build/lib/keras/layers
copying keras/layers/local.py -> build/lib/keras/layers
copying keras/layers/merge.py -> build/lib/keras/layers
copying keras/layers/noise.py -> build/lib/keras/layers
copying keras/layers/normalization.py -> build/lib/keras/layers
copying keras/layers/pooling.py -> build/lib/keras/layers
copying keras/layers/recurrent.py -> build/lib/keras/layers
copying keras/layers/wrappers.py -> build/lib/keras/layers
copying keras/layers/__init__.py -> build/lib/keras/layers
creating build/lib/keras/legacy
copying keras/legacy/interfaces.py -> build/lib/keras/legacy
copying keras/legacy/layers.py -> build/lib/keras/legacy
copying keras/legacy/__init__.py -> build/lib/keras/legacy
creating build/lib/keras/preprocessing
copying keras/preprocessing/image.py -> build/lib/keras/preprocessing
copying keras/preprocessing/sequence.py -> build/lib/keras/preprocessing
copying keras/preprocessing/text.py -> build/lib/keras/preprocessing
copying keras/preprocessing/__init__.py -> build/lib/keras/preprocessing
creating build/lib/keras/utils
copying keras/utils/conv_utils.py -> build/lib/keras/utils
copying keras/utils/data_utils.py -> build/lib/keras/utils
copying keras/utils/generic_utils.py -> build/lib/keras/utils
copying keras/utils/io_utils.py -> build/lib/keras/utils
copying keras/utils/layer_utils.py -> build/lib/keras/utils
copying keras/utils/multi_gpu_utils.py -> build/lib/keras/utils
copying keras/utils/np_utils.py -> build/lib/keras/utils
copying keras/utils/test_utils.py -> build/lib/keras/utils
copying keras/utils/vis_utils.py -> build/lib/keras/utils
copying keras/utils/__init__.py -> build/lib/keras/utils
creating build/lib/keras/wrappers
copying keras/wrappers/scikit_learn.py -> build/lib/keras/wrappers
copying keras/wrappers/__init__.py -> build/lib/keras/wrappers
creating build/bdist.linux-x86_64
creating build/bdist.linux-x86_64/egg
creating build/bdist.linux-x86_64/egg/docs
copying build/lib/docs/autogen.py -> build/bdist.linux-x86_64/egg/docs
copying build/lib/docs/__init__.py -> build/bdist.linux-x86_64/egg/docs
creating build/bdist.linux-x86_64/egg/keras
copying build/lib/keras/activations.py -> build/bdist.linux-x86_64/egg/keras
creating build/bdist.linux-x86_64/egg/keras/applications
copying build/lib/keras/applications/densenet.py -> build/bdist.linux-x86_64/egg/keras/applications
copying build/lib/keras/applications/imagenet_utils.py -> build/bdist.linux-x86_64/egg/keras/applications
copying build/lib/keras/applications/inception_resnet_v2.py -> build/bdist.linux-x86_64/egg/keras/applications
copying build/lib/keras/applications/inception_v3.py -> build/bdist.linux-x86_64/egg/keras/applications
copying build/lib/keras/applications/mobilenet.py -> build/bdist.linux-x86_64/egg/keras/applications
copying build/lib/keras/applications/mobilenetv2.py -> build/bdist.linux-x86_64/egg/keras/applications
copying build/lib/keras/applications/nasnet.py -> build/bdist.linux-x86_64/egg/keras/applications
copying build/lib/keras/applications/resnet50.py -> build/bdist.linux-x86_64/egg/keras/applications
copying build/lib/keras/applications/vgg16.py -> build/bdist.linux-x86_64/egg/keras/applications
copying build/lib/keras/applications/vgg19.py -> build/bdist.linux-x86_64/egg/keras/applications
copying build/lib/keras/applications/xception.py -> build/bdist.linux-x86_64/egg/keras/applications
copying build/lib/keras/applications/__init__.py -> build/bdist.linux-x86_64/egg/keras/applications
creating build/bdist.linux-x86_64/egg/keras/backend
copying build/lib/keras/backend/cntk_backend.py -> build/bdist.linux-x86_64/egg/keras/backend
copying build/lib/keras/backend/common.py -> build/bdist.linux-x86_64/egg/keras/backend
copying build/lib/keras/backend/tensorflow_backend.py -> build/bdist.linux-x86_64/egg/keras/backend
copying build/lib/keras/backend/theano_backend.py -> build/bdist.linux-x86_64/egg/keras/backend
copying build/lib/keras/backend/__init__.py -> build/bdist.linux-x86_64/egg/keras/backend
copying build/lib/keras/callbacks.py -> build/bdist.linux-x86_64/egg/keras
copying build/lib/keras/constraints.py -> build/bdist.linux-x86_64/egg/keras
creating build/bdist.linux-x86_64/egg/keras/datasets
copying build/lib/keras/datasets/boston_housing.py -> build/bdist.linux-x86_64/egg/keras/datasets
copying build/lib/keras/datasets/cifar.py -> build/bdist.linux-x86_64/egg/keras/datasets
copying build/lib/keras/datasets/cifar10.py -> build/bdist.linux-x86_64/egg/keras/datasets
copying build/lib/keras/datasets/cifar100.py -> build/bdist.linux-x86_64/egg/keras/datasets
copying build/lib/keras/datasets/fashion_mnist.py -> build/bdist.linux-x86_64/egg/keras/datasets
copying build/lib/keras/datasets/imdb.py -> build/bdist.linux-x86_64/egg/keras/datasets
copying build/lib/keras/datasets/mnist.py -> build/bdist.linux-x86_64/egg/keras/datasets
copying build/lib/keras/datasets/reuters.py -> build/bdist.linux-x86_64/egg/keras/datasets
copying build/lib/keras/datasets/__init__.py -> build/bdist.linux-x86_64/egg/keras/datasets
creating build/bdist.linux-x86_64/egg/keras/engine
copying build/lib/keras/engine/base_layer.py -> build/bdist.linux-x86_64/egg/keras/engine
copying build/lib/keras/engine/input_layer.py -> build/bdist.linux-x86_64/egg/keras/engine
copying build/lib/keras/engine/network.py -> build/bdist.linux-x86_64/egg/keras/engine
copying build/lib/keras/engine/saving.py -> build/bdist.linux-x86_64/egg/keras/engine
copying build/lib/keras/engine/sequential.py -> build/bdist.linux-x86_64/egg/keras/engine
copying build/lib/keras/engine/topology.py -> build/bdist.linux-x86_64/egg/keras/engine
copying build/lib/keras/engine/training.py -> build/bdist.linux-x86_64/egg/keras/engine
copying build/lib/keras/engine/training_arrays.py -> build/bdist.linux-x86_64/egg/keras/engine
copying build/lib/keras/engine/training_generator.py -> build/bdist.linux-x86_64/egg/keras/engine
copying build/lib/keras/engine/training_utils.py -> build/bdist.linux-x86_64/egg/keras/engine
copying build/lib/keras/engine/__init__.py -> build/bdist.linux-x86_64/egg/keras/engine
copying build/lib/keras/initializers.py -> build/bdist.linux-x86_64/egg/keras
creating build/bdist.linux-x86_64/egg/keras/layers
copying build/lib/keras/layers/advanced_activations.py -> build/bdist.linux-x86_64/egg/keras/layers
copying build/lib/keras/layers/convolutional.py -> build/bdist.linux-x86_64/egg/keras/layers
copying build/lib/keras/layers/convolutional_recurrent.py -> build/bdist.linux-x86_64/egg/keras/layers
copying build/lib/keras/layers/core.py -> build/bdist.linux-x86_64/egg/keras/layers
copying build/lib/keras/layers/cudnn_recurrent.py -> build/bdist.linux-x86_64/egg/keras/layers
copying build/lib/keras/layers/embeddings.py -> build/bdist.linux-x86_64/egg/keras/layers
copying build/lib/keras/layers/local.py -> build/bdist.linux-x86_64/egg/keras/layers
copying build/lib/keras/layers/merge.py -> build/bdist.linux-x86_64/egg/keras/layers
copying build/lib/keras/layers/noise.py -> build/bdist.linux-x86_64/egg/keras/layers
copying build/lib/keras/layers/normalization.py -> build/bdist.linux-x86_64/egg/keras/layers
copying build/lib/keras/layers/pooling.py -> build/bdist.linux-x86_64/egg/keras/layers
copying build/lib/keras/layers/recurrent.py -> build/bdist.linux-x86_64/egg/keras/layers
copying build/lib/keras/layers/wrappers.py -> build/bdist.linux-x86_64/egg/keras/layers
copying build/lib/keras/layers/__init__.py -> build/bdist.linux-x86_64/egg/keras/layers
creating build/bdist.linux-x86_64/egg/keras/legacy
copying build/lib/keras/legacy/interfaces.py -> build/bdist.linux-x86_64/egg/keras/legacy
copying build/lib/keras/legacy/layers.py -> build/bdist.linux-x86_64/egg/keras/legacy
copying build/lib/keras/legacy/__init__.py -> build/bdist.linux-x86_64/egg/keras/legacy
copying build/lib/keras/losses.py -> build/bdist.linux-x86_64/egg/keras
copying build/lib/keras/metrics.py -> build/bdist.linux-x86_64/egg/keras
copying build/lib/keras/models.py -> build/bdist.linux-x86_64/egg/keras
copying build/lib/keras/objectives.py -> build/bdist.linux-x86_64/egg/keras
copying build/lib/keras/optimizers.py -> build/bdist.linux-x86_64/egg/keras
creating build/bdist.linux-x86_64/egg/keras/preprocessing
copying build/lib/keras/preprocessing/image.py -> build/bdist.linux-x86_64/egg/keras/preprocessing
copying build/lib/keras/preprocessing/sequence.py -> build/bdist.linux-x86_64/egg/keras/preprocessing
copying build/lib/keras/preprocessing/text.py -> build/bdist.linux-x86_64/egg/keras/preprocessing
copying build/lib/keras/preprocessing/__init__.py -> build/bdist.linux-x86_64/egg/keras/preprocessing
copying build/lib/keras/regularizers.py -> build/bdist.linux-x86_64/egg/keras
creating build/bdist.linux-x86_64/egg/keras/utils
copying build/lib/keras/utils/conv_utils.py -> build/bdist.linux-x86_64/egg/keras/utils
copying build/lib/keras/utils/data_utils.py -> build/bdist.linux-x86_64/egg/keras/utils
copying build/lib/keras/utils/generic_utils.py -> build/bdist.linux-x86_64/egg/keras/utils
copying build/lib/keras/utils/io_utils.py -> build/bdist.linux-x86_64/egg/keras/utils
copying build/lib/keras/utils/layer_utils.py -> build/bdist.linux-x86_64/egg/keras/utils
copying build/lib/keras/utils/multi_gpu_utils.py -> build/bdist.linux-x86_64/egg/keras/utils
copying build/lib/keras/utils/np_utils.py -> build/bdist.linux-x86_64/egg/keras/utils
copying build/lib/keras/utils/test_utils.py -> build/bdist.linux-x86_64/egg/keras/utils
copying build/lib/keras/utils/vis_utils.py -> build/bdist.linux-x86_64/egg/keras/utils
copying build/lib/keras/utils/__init__.py -> build/bdist.linux-x86_64/egg/keras/utils
creating build/bdist.linux-x86_64/egg/keras/wrappers
copying build/lib/keras/wrappers/scikit_learn.py -> build/bdist.linux-x86_64/egg/keras/wrappers
copying build/lib/keras/wrappers/__init__.py -> build/bdist.linux-x86_64/egg/keras/wrappers
copying build/lib/keras/__init__.py -> build/bdist.linux-x86_64/egg/keras
byte-compiling build/bdist.linux-x86_64/egg/docs/autogen.py to autogen.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/docs/__init__.py to __init__.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/keras/activations.py to activations.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/keras/applications/densenet.py to densenet.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/keras/applications/imagenet_utils.py to imagenet_utils.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/keras/applications/inception_resnet_v2.py to inception_resnet_v2.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/keras/applications/inception_v3.py to inception_v3.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/keras/applications/mobilenet.py to mobilenet.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/keras/applications/mobilenetv2.py to mobilenetv2.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/keras/applications/nasnet.py to nasnet.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/keras/applications/resnet50.py to resnet50.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/keras/applications/vgg16.py to vgg16.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/keras/applications/vgg19.py to vgg19.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/keras/applications/xception.py to xception.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/keras/applications/__init__.py to __init__.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/keras/backend/cntk_backend.py to cntk_backend.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/keras/backend/common.py to common.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/keras/backend/tensorflow_backend.py to tensorflow_backend.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/keras/backend/theano_backend.py to theano_backend.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/keras/backend/__init__.py to __init__.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/keras/callbacks.py to callbacks.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/keras/constraints.py to constraints.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/keras/datasets/boston_housing.py to boston_housing.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/keras/datasets/cifar.py to cifar.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/keras/datasets/cifar10.py to cifar10.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/keras/datasets/cifar100.py to cifar100.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/keras/datasets/fashion_mnist.py to fashion_mnist.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/keras/datasets/imdb.py to imdb.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/keras/datasets/mnist.py to mnist.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/keras/datasets/reuters.py to reuters.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/keras/datasets/__init__.py to __init__.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/keras/engine/base_layer.py to base_layer.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/keras/engine/input_layer.py to input_layer.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/keras/engine/network.py to network.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/keras/engine/saving.py to saving.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/keras/engine/sequential.py to sequential.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/keras/engine/topology.py to topology.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/keras/engine/training.py to training.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/keras/engine/training_arrays.py to training_arrays.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/keras/engine/training_generator.py to training_generator.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/keras/engine/training_utils.py to training_utils.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/keras/engine/__init__.py to __init__.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/keras/initializers.py to initializers.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/keras/layers/advanced_activations.py to advanced_activations.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/keras/layers/convolutional.py to convolutional.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/keras/layers/convolutional_recurrent.py to convolutional_recurrent.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/keras/layers/core.py to core.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/keras/layers/cudnn_recurrent.py to cudnn_recurrent.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/keras/layers/embeddings.py to embeddings.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/keras/layers/local.py to local.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/keras/layers/merge.py to merge.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/keras/layers/noise.py to noise.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/keras/layers/normalization.py to normalization.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/keras/layers/pooling.py to pooling.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/keras/layers/recurrent.py to recurrent.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/keras/layers/wrappers.py to wrappers.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/keras/layers/__init__.py to __init__.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/keras/legacy/interfaces.py to interfaces.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/keras/legacy/layers.py to layers.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/keras/legacy/__init__.py to __init__.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/keras/losses.py to losses.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/keras/metrics.py to metrics.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/keras/models.py to models.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/keras/objectives.py to objectives.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/keras/optimizers.py to optimizers.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/keras/preprocessing/image.py to image.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/keras/preprocessing/sequence.py to sequence.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/keras/preprocessing/text.py to text.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/keras/preprocessing/__init__.py to __init__.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/keras/regularizers.py to regularizers.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/keras/utils/conv_utils.py to conv_utils.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/keras/utils/data_utils.py to data_utils.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/keras/utils/generic_utils.py to generic_utils.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/keras/utils/io_utils.py to io_utils.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/keras/utils/layer_utils.py to layer_utils.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/keras/utils/multi_gpu_utils.py to multi_gpu_utils.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/keras/utils/np_utils.py to np_utils.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/keras/utils/test_utils.py to test_utils.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/keras/utils/vis_utils.py to vis_utils.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/keras/utils/__init__.py to __init__.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/keras/wrappers/scikit_learn.py to scikit_learn.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/keras/wrappers/__init__.py to __init__.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/keras/__init__.py to __init__.cpython-36.pyc
creating build/bdist.linux-x86_64/egg/EGG-INFO
copying Keras.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
copying Keras.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying Keras.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying Keras.egg-info/requires.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying Keras.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
zip_safe flag not set; analyzing archive contents...
creating dist
creating 'dist/Keras-2.2.0-py3.6.egg' and adding 'build/bdist.linux-x86_64/egg' to it
removing 'build/bdist.linux-x86_64/egg' (and everything under it)
Processing Keras-2.2.0-py3.6.egg
Copying Keras-2.2.0-py3.6.egg to /usr/local/lib/python3.6/dist-packages
Adding Keras 2.2.0 to easy-install.pth file

Installed /usr/local/lib/python3.6/dist-packages/Keras-2.2.0-py3.6.egg
Processing dependencies for Keras==2.2.0
Searching for Keras-Preprocessing==1.0.1
Best match: Keras-Preprocessing 1.0.1
Adding Keras-Preprocessing 1.0.1 to easy-install.pth file

Using /usr/local/lib/python3.6/dist-packages
Searching for Keras-Applications==1.0.2
Best match: Keras-Applications 1.0.2
Adding Keras-Applications 1.0.2 to easy-install.pth file

Using /usr/local/lib/python3.6/dist-packages
Searching for h5py==2.8.0
Best match: h5py 2.8.0
Adding h5py 2.8.0 to easy-install.pth file

Using /usr/local/lib/python3.6/dist-packages
Searching for PyYAML==3.13
Best match: PyYAML 3.13
Adding PyYAML 3.13 to easy-install.pth file

Using /usr/local/lib/python3.6/dist-packages
Searching for six==1.11.0
Best match: six 1.11.0
Adding six 1.11.0 to easy-install.pth file

Using /usr/lib/python3/dist-packages
Searching for scipy==1.1.0
Best match: scipy 1.1.0
Adding scipy 1.1.0 to easy-install.pth file

Using /usr/local/lib/python3.6/dist-packages
Searching for numpy==1.14.5
Best match: numpy 1.14.5
Adding numpy 1.14.5 to easy-install.pth file

Using /usr/local/lib/python3.6/dist-packages
Finished processing dependencies for Keras==2.2.0

That's all for today. I think Python is seriously cool, handy indeed. I myself will still recommend Pytorch, but it seems Tensorflow and Keras are also very popular in North America.