AI Model Visualization By Tensorspace - 3D Interactive

Visited Green Timbers Lake again.

The Grassland Ducks In the Lake A Pair of Ducks In The Lake
The Grassland Ducks In the Lake A Pair of Ducks In The Lake
The Lake Me In Facial Mask for COVID-19 The Lake - The Other Side
The Lake Me In Facial Mask for COVID-19 The Lake - The Other Side

1. About Tensorspace

2. Let's Have Some Fun

We FIRST create an empty project folder, here, named as WebTensorspace.

2.1 Follow Towards Data Science Blog FIRST

Let's strictly follow this part of Towards Data Science Blog (cited from Towards Data Science Blog).

Finally we need to create .html file which will output the result. Not to spend time on setting-up TensorFlow.js and JQuery I encourage you just to use my template at TensorSpace folder. The folder structure looks as following:

  • index.html — out html file to run visualization
  • lib/ — folder storing all the dependencies
  • data/ — folder containing .json file with network inputs
  • model/ — folder containing exported model

For our html file we need to first import dependecies and write a TensorSpace script.

Now, let's take a look at our project.

1
2
➜  WebTensorspace ls
data index.html lib model

2.1.1 lib

Three resource is referred to download ALL required libraries.

Some required libraries suggested by me:

Now, let's take a look at what's under folder lib.

1
2
3
➜  WebTensorspace ls lib
Chart.min.js signature_pad.min.js tensorspace.min.js tf.min.js.map TrackballControls.js
jquery.min.js stats.min.js tf.min.js three.min.js tween.cjs.js

2.1.2 model

Let's just use tf_keras_model.h5 provided by TensorSpace as our example. You may have to click on the Download button to have this tf_keras_model.h5 downloaded into folder model.

1
2
➜  WebTensorspace ls model 
tf_keras_model.h5

2.1.2.1 tensorspacejs_converter Failed to Run

Now, let's try to run the following command:

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
➜  WebTensorspace tensorspacejs_converter \                              
--input_model_from="tensorflow" \
--input_model_format="tf_keras" \
--output_layer_names="padding_1,conv_1,maxpool_1,conv_2,maxpool_2,dense_1,dense_2,softmax" \
./model/tf_keras_model.h5 \
./model/converted
Traceback (most recent call last):
File "~/.local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 584, in _build_master
ws.require(__requires__)
File "~/.local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 901, in require
needed = self.resolve(parse_requirements(requirements))
File "~/.local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 792, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (tensorboard 2.2.1 (~/.local/lib/python3.6/site-packages), Requirement.parse('tensorboard<2.2.0,>=2.1.0'), {'tensorflow'})

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "~/.local/bin/tensorspacejs_converter", line 6, in <module>
from pkg_resources import load_entry_point
File "~/.local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3258, in <module>
@_call_aside
File "~/.local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3242, in _call_aside
f(*args, **kwargs)
File "~/.local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 3271, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "~/.local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 586, in _build_master
return cls._build_from_requirements(__requires__)
File "~/.local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 599, in _build_from_requirements
dists = ws.resolve(reqs, Environment())
File "~/.local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 787, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'tensorflow-estimator<2.2.0,>=2.1.0' distribution was not found and is required by tensorflow

Clearly, we can downgrade tensorflow-estimator from 2.2.0 to 2.1.0.

1
2
3
4
5
6
7
8
9
10
11
➜  WebTensorspace pip show tensorflow_estimator
Name: tensorflow-estimator
Version: 2.1.0
Summary: TensorFlow Estimator.
Home-page: https://www.tensorflow.org/
Author: Google Inc.
Author-email: UNKNOWN
License: Apache 2.0
Location: ~/.local/lib/python3.6/site-packages
Requires:
Required-by: tensorflow

Now, we try to re-run the above tensorspacejs_converter command:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
➜  WebTensorspace tensorspacejs_converter \                     
--input_model_from="tensorflow" \
--input_model_format="tf_keras" \
--output_layer_names="padding_1,conv_1,maxpool_1,conv_2,maxpool_2,dense_1,dense_2,softmax" \
./model/tf_keras_model.h5 \
./model/converted
Using TensorFlow backend.
Traceback (most recent call last):
File "~/.local/bin/tensorspacejs_converter", line 11, in <module>
load_entry_point('tensorspacejs==0.2.0', 'console_scripts', 'tensorspacejs_converter')()
File "~/.local/lib/python3.6/site-packages/tensorspacejs-0.2.0-py3.6.egg/tensorspacejs/tsp_converters.py", line 167, in main
flags.output_layer_names
File "~/.local/lib/python3.6/site-packages/tensorspacejs-0.2.0-py3.6.egg/tensorspacejs/tf/tensorflow_conversion.py", line 35, in preprocess_tensorflow_model
output_node_names
File "~/.local/lib/python3.6/site-packages/tensorspacejs-0.2.0-py3.6.egg/tensorspacejs/tf/keras_model.py", line 15, in preprocess_hdf5_combined_model
with K.get_session():
File "~/.local/lib/python3.6/site-packages/Keras-2.3.1-py3.6.egg/keras/backend/tensorflow_backend.py", line 379, in get_session
'`get_session` is not available '
RuntimeError: `get_session` is not available when using TensorFlow 2.0.

2.1.2.2 Install tfjs-converter

Please checkout tfjs and enter tfjs-converter, and then have the python package installed tfjs-converter/python

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
➜  python git:(master) ✗ pwd
....../tfjs/tfjs-converter/python
➜ python git:(master) ✗ python setup.py install --user
running install
running bdist_egg
running egg_info
writing tensorflowjs.egg-info/PKG-INFO
writing dependency_links to tensorflowjs.egg-info/dependency_links.txt
writing entry points to tensorflowjs.egg-info/entry_points.txt
writing requirements to tensorflowjs.egg-info/requires.txt
writing top-level names to tensorflowjs.egg-info/top_level.txt
file tensorflowjs.py (for module tensorflowjs) not found
file tensorflowjs/converters.py (for module tensorflowjs.converters) not found
package init file 'tensorflowjs/op_list/__init__.py' not found (or not a regular file)
reading manifest template 'MANIFEST.in'
writing manifest file 'tensorflowjs.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
file tensorflowjs.py (for module tensorflowjs) not found
file tensorflowjs/converters.py (for module tensorflowjs.converters) not found
file tensorflowjs.py (for module tensorflowjs) not found
file tensorflowjs/converters.py (for module tensorflowjs.converters) not found
creating build/bdist.linux-x86_64/egg
creating build/bdist.linux-x86_64/egg/tensorflowjs
creating build/bdist.linux-x86_64/egg/tensorflowjs/converters
copying build/lib/tensorflowjs/converters/common.py -> build/bdist.linux-x86_64/egg/tensorflowjs/converters
copying build/lib/tensorflowjs/converters/converter.py -> build/bdist.linux-x86_64/egg/tensorflowjs/converters
copying build/lib/tensorflowjs/converters/fold_batch_norms.py -> build/bdist.linux-x86_64/egg/tensorflowjs/converters
copying build/lib/tensorflowjs/converters/fuse_depthwise_conv2d.py -> build/bdist.linux-x86_64/egg/tensorflowjs/converters
copying build/lib/tensorflowjs/converters/fuse_prelu.py -> build/bdist.linux-x86_64/egg/tensorflowjs/converters
copying build/lib/tensorflowjs/converters/graph_rewrite_util.py -> build/bdist.linux-x86_64/egg/tensorflowjs/converters
copying build/lib/tensorflowjs/converters/keras_h5_conversion.py -> build/bdist.linux-x86_64/egg/tensorflowjs/converters
copying build/lib/tensorflowjs/converters/keras_tfjs_loader.py -> build/bdist.linux-x86_64/egg/tensorflowjs/converters
copying build/lib/tensorflowjs/converters/tf_saved_model_conversion_v2.py -> build/bdist.linux-x86_64/egg/tensorflowjs/converters
copying build/lib/tensorflowjs/converters/wizard.py -> build/bdist.linux-x86_64/egg/tensorflowjs/converters
copying build/lib/tensorflowjs/converters/__init__.py -> build/bdist.linux-x86_64/egg/tensorflowjs/converters
creating build/bdist.linux-x86_64/egg/tensorflowjs/op_list
copying build/lib/tensorflowjs/op_list/arithmetic.json -> build/bdist.linux-x86_64/egg/tensorflowjs/op_list
copying build/lib/tensorflowjs/op_list/basic_math.json -> build/bdist.linux-x86_64/egg/tensorflowjs/op_list
copying build/lib/tensorflowjs/op_list/control.json -> build/bdist.linux-x86_64/egg/tensorflowjs/op_list
copying build/lib/tensorflowjs/op_list/convolution.json -> build/bdist.linux-x86_64/egg/tensorflowjs/op_list
copying build/lib/tensorflowjs/op_list/creation.json -> build/bdist.linux-x86_64/egg/tensorflowjs/op_list
copying build/lib/tensorflowjs/op_list/dynamic.json -> build/bdist.linux-x86_64/egg/tensorflowjs/op_list
copying build/lib/tensorflowjs/op_list/evaluation.json -> build/bdist.linux-x86_64/egg/tensorflowjs/op_list
copying build/lib/tensorflowjs/op_list/graph.json -> build/bdist.linux-x86_64/egg/tensorflowjs/op_list
copying build/lib/tensorflowjs/op_list/image.json -> build/bdist.linux-x86_64/egg/tensorflowjs/op_list
copying build/lib/tensorflowjs/op_list/logical.json -> build/bdist.linux-x86_64/egg/tensorflowjs/op_list
copying build/lib/tensorflowjs/op_list/matrices.json -> build/bdist.linux-x86_64/egg/tensorflowjs/op_list
copying build/lib/tensorflowjs/op_list/normalization.json -> build/bdist.linux-x86_64/egg/tensorflowjs/op_list
copying build/lib/tensorflowjs/op_list/reduction.json -> build/bdist.linux-x86_64/egg/tensorflowjs/op_list
copying build/lib/tensorflowjs/op_list/slice_join.json -> build/bdist.linux-x86_64/egg/tensorflowjs/op_list
copying build/lib/tensorflowjs/op_list/spectral.json -> build/bdist.linux-x86_64/egg/tensorflowjs/op_list
copying build/lib/tensorflowjs/op_list/transformation.json -> build/bdist.linux-x86_64/egg/tensorflowjs/op_list
copying build/lib/tensorflowjs/quantization.py -> build/bdist.linux-x86_64/egg/tensorflowjs
copying build/lib/tensorflowjs/read_weights.py -> build/bdist.linux-x86_64/egg/tensorflowjs
copying build/lib/tensorflowjs/resource_loader.py -> build/bdist.linux-x86_64/egg/tensorflowjs
copying build/lib/tensorflowjs/version.py -> build/bdist.linux-x86_64/egg/tensorflowjs
copying build/lib/tensorflowjs/write_weights.py -> build/bdist.linux-x86_64/egg/tensorflowjs
copying build/lib/tensorflowjs/__init__.py -> build/bdist.linux-x86_64/egg/tensorflowjs
byte-compiling build/bdist.linux-x86_64/egg/tensorflowjs/converters/common.py to common.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/tensorflowjs/converters/converter.py to converter.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/tensorflowjs/converters/fold_batch_norms.py to fold_batch_norms.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/tensorflowjs/converters/fuse_depthwise_conv2d.py to fuse_depthwise_conv2d.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/tensorflowjs/converters/fuse_prelu.py to fuse_prelu.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/tensorflowjs/converters/graph_rewrite_util.py to graph_rewrite_util.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/tensorflowjs/converters/keras_h5_conversion.py to keras_h5_conversion.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/tensorflowjs/converters/keras_tfjs_loader.py to keras_tfjs_loader.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/tensorflowjs/converters/tf_saved_model_conversion_v2.py to tf_saved_model_conversion_v2.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/tensorflowjs/converters/wizard.py to wizard.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/tensorflowjs/converters/__init__.py to __init__.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/tensorflowjs/quantization.py to quantization.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/tensorflowjs/read_weights.py to read_weights.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/tensorflowjs/resource_loader.py to resource_loader.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/tensorflowjs/version.py to version.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/tensorflowjs/write_weights.py to write_weights.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/tensorflowjs/__init__.py to __init__.cpython-36.pyc
creating build/bdist.linux-x86_64/egg/EGG-INFO
copying tensorflowjs.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
copying tensorflowjs.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying tensorflowjs.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying tensorflowjs.egg-info/entry_points.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying tensorflowjs.egg-info/requires.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying tensorflowjs.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
zip_safe flag not set; analyzing archive contents...
tensorflowjs.__pycache__.resource_loader.cpython-36: module references __file__
creating 'dist/tensorflowjs-1.7.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 tensorflowjs-1.7.0-py3.6.egg
creating ~/.local/lib/python3.6/site-packages/tensorflowjs-1.7.0-py3.6.egg
Extracting tensorflowjs-1.7.0-py3.6.egg to ~/.local/lib/python3.6/site-packages
Adding tensorflowjs 1.7.0 to easy-install.pth file
Installing tensorflowjs_converter script to ~/.local/bin
Installing tensorflowjs_wizard script to ~/.local/bin

Installed ~/.local/lib/python3.6/site-packages/tensorflowjs-1.7.0-py3.6.egg
Processing dependencies for tensorflowjs==1.7.0
Searching for PyInquirer==1.0.3
Best match: PyInquirer 1.0.3
Adding PyInquirer 1.0.3 to easy-install.pth file

Using ~/.local/lib/python3.6/site-packages
Not found: prompt_toolkit==1.0.14
Not found: Pygments>=2.2.0
Not found: regex>=2016.11.21
Searching for gast==0.3.3
Best match: gast 0.3.3
Adding gast 0.3.3 to easy-install.pth file

Using ~/.local/lib/python3.6/site-packages
Searching for tensorflow-hub==0.8.0
Best match: tensorflow-hub 0.8.0
Adding tensorflow-hub 0.8.0 to easy-install.pth file
Installing make_image_classifier script to ~/.local/bin
Installing make_nearest_neighbour_index script to ~/.local/bin

Using ~/.local/lib/python3.6/site-packages
Searching for tensorflow==2.1.0
Best match: tensorflow 2.1.0
Adding tensorflow 2.1.0 to easy-install.pth file
Installing estimator_ckpt_converter script to ~/.local/bin
Installing saved_model_cli script to ~/.local/bin
Installing tensorboard script to ~/.local/bin
Installing tf_upgrade_v2 script to ~/.local/bin
Installing tflite_convert script to ~/.local/bin
Installing toco script to ~/.local/bin
Installing toco_from_protos script to ~/.local/bin

Using ~/.local/lib/python3.6/site-packages
Searching for six==1.14.0
Best match: six 1.14.0
Adding six 1.14.0 to easy-install.pth file

Using ~/.local/lib/python3.6/site-packages
Searching for numpy==1.18.2
Best match: numpy 1.18.2
Adding numpy 1.18.2 to easy-install.pth file
Installing f2py script to ~/.local/bin
Installing f2py3 script to ~/.local/bin
Installing f2py3.6 script to ~/.local/bin

Using ~/.local/lib/python3.6/site-packages
Searching for h5py==2.10.0
Best match: h5py 2.10.0
Adding h5py 2.10.0 to easy-install.pth file

Using ~/.local/lib/python3.6/site-packages
Searching for prompt-toolkit==1.0.14
Best match: prompt-toolkit 1.0.14
Processing prompt_toolkit-1.0.14-py3.6.egg
prompt-toolkit 1.0.14 is already the active version in easy-install.pth

Using ~/.local/lib/python3.6/site-packages/prompt_toolkit-1.0.14-py3.6.egg
Searching for regex==2020.4.4
Best match: regex 2020.4.4
Adding regex 2020.4.4 to easy-install.pth file

Using ~/.local/lib/python3.6/site-packages
Searching for Pygments==2.6.1
Best match: Pygments 2.6.1
Adding Pygments 2.6.1 to easy-install.pth file
Installing pygmentize script to ~/.local/bin

Using ~/.local/lib/python3.6/site-packages
Searching for protobuf==3.11.3
Best match: protobuf 3.11.3
Adding protobuf 3.11.3 to easy-install.pth file

Using ~/.local/lib/python3.6/site-packages
Searching for grpcio==1.28.1
Best match: grpcio 1.28.1
Adding grpcio 1.28.1 to easy-install.pth file

Using ~/.local/lib/python3.6/site-packages
Searching for opt-einsum==3.2.1
Best match: opt-einsum 3.2.1
Adding opt-einsum 3.2.1 to easy-install.pth file

Using ~/.local/lib/python3.6/site-packages
Searching for Keras-Preprocessing==1.1.0
Best match: Keras-Preprocessing 1.1.0
Adding Keras-Preprocessing 1.1.0 to easy-install.pth file

Using ~/.local/lib/python3.6/site-packages
Searching for wrapt==1.12.1
Best match: wrapt 1.12.1
Adding wrapt 1.12.1 to easy-install.pth file

Using ~/.local/lib/python3.6/site-packages
Searching for scipy==1.4.1
Best match: scipy 1.4.1
Adding scipy 1.4.1 to easy-install.pth file

Using ~/.local/lib/python3.6/site-packages
Searching for tensorflow-estimator==2.1.0
Best match: tensorflow-estimator 2.1.0
Adding tensorflow-estimator 2.1.0 to easy-install.pth file

Using ~/.local/lib/python3.6/site-packages
Searching for tensorboard==2.1.1
Best match: tensorboard 2.1.1
Processing tensorboard-2.1.1-py3.6.egg
tensorboard 2.1.1 is already the active version in easy-install.pth
Installing tensorboard script to ~/.local/bin

Using ~/.local/lib/python3.6/site-packages/tensorboard-2.1.1-py3.6.egg
Searching for astunparse==1.6.3
Best match: astunparse 1.6.3
Adding astunparse 1.6.3 to easy-install.pth file

Using ~/.local/lib/python3.6/site-packages
Searching for google-pasta==0.2.0
Best match: google-pasta 0.2.0
Adding google-pasta 0.2.0 to easy-install.pth file

Using ~/.local/lib/python3.6/site-packages
Searching for termcolor==1.1.0
Best match: termcolor 1.1.0
Adding termcolor 1.1.0 to easy-install.pth file

Using ~/.local/lib/python3.6/site-packages
Searching for absl-py==0.9.0
Best match: absl-py 0.9.0
Adding absl-py 0.9.0 to easy-install.pth file

Using ~/.local/lib/python3.6/site-packages
Searching for wheel==0.34.2
Best match: wheel 0.34.2
Adding wheel 0.34.2 to easy-install.pth file
Installing wheel script to ~/.local/bin

Using ~/.local/lib/python3.6/site-packages
Searching for wcwidth==0.1.9
Best match: wcwidth 0.1.9
Adding wcwidth 0.1.9 to easy-install.pth file

Using ~/.local/lib/python3.6/site-packages
Searching for setuptools==46.1.3
Best match: setuptools 46.1.3
Adding setuptools 46.1.3 to easy-install.pth file
Installing easy_install script to ~/.local/bin
Installing easy_install-3.8 script to ~/.local/bin

Using ~/.local/lib/python3.6/site-packages
Searching for Werkzeug==1.0.1
Best match: Werkzeug 1.0.1
Adding Werkzeug 1.0.1 to easy-install.pth file

Using ~/.local/lib/python3.6/site-packages
Searching for requests==2.23.0
Best match: requests 2.23.0
Adding requests 2.23.0 to easy-install.pth file

Using ~/.local/lib/python3.6/site-packages
Searching for Markdown==3.2.1
Best match: Markdown 3.2.1
Adding Markdown 3.2.1 to easy-install.pth file
Installing markdown_py script to ~/.local/bin

Using ~/.local/lib/python3.6/site-packages
Searching for google-auth==1.14.0
Best match: google-auth 1.14.0
Adding google-auth 1.14.0 to easy-install.pth file

Using ~/.local/lib/python3.6/site-packages
Searching for google-auth-oauthlib==0.4.1
Best match: google-auth-oauthlib 0.4.1
Adding google-auth-oauthlib 0.4.1 to easy-install.pth file
Installing google-oauthlib-tool script to ~/.local/bin

Using ~/.local/lib/python3.6/site-packages
Searching for urllib3==1.25.9
Best match: urllib3 1.25.9
Adding urllib3 1.25.9 to easy-install.pth file

Using ~/.local/lib/python3.6/site-packages
Searching for idna==2.9
Best match: idna 2.9
Adding idna 2.9 to easy-install.pth file

Using ~/.local/lib/python3.6/site-packages
Searching for certifi==2020.4.5.1
Best match: certifi 2020.4.5.1
Adding certifi 2020.4.5.1 to easy-install.pth file

Using ~/.local/lib/python3.6/site-packages
Searching for chardet==3.0.4
Best match: chardet 3.0.4
Adding chardet 3.0.4 to easy-install.pth file
Installing chardetect script to ~/.local/bin

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

Using ~/.local/lib/python3.6/site-packages
Searching for cachetools==4.1.0
Best match: cachetools 4.1.0
Adding cachetools 4.1.0 to easy-install.pth file

Using ~/.local/lib/python3.6/site-packages
Searching for rsa==4.0
Best match: rsa 4.0
Adding rsa 4.0 to easy-install.pth file
Installing pyrsa-decrypt script to ~/.local/bin
Installing pyrsa-encrypt script to ~/.local/bin
Installing pyrsa-keygen script to ~/.local/bin
Installing pyrsa-priv2pub script to ~/.local/bin
Installing pyrsa-sign script to ~/.local/bin
Installing pyrsa-verify script to ~/.local/bin

Using ~/.local/lib/python3.6/site-packages
Searching for requests-oauthlib==1.3.0
Best match: requests-oauthlib 1.3.0
Adding requests-oauthlib 1.3.0 to easy-install.pth file

Using ~/.local/lib/python3.6/site-packages
Searching for pyasn1==0.4.8
Best match: pyasn1 0.4.8
Adding pyasn1 0.4.8 to easy-install.pth file

Using ~/.local/lib/python3.6/site-packages
Searching for oauthlib==3.1.0
Best match: oauthlib 3.1.0
Adding oauthlib 3.1.0 to easy-install.pth file

Using ~/.local/lib/python3.6/site-packages
Finished processing dependencies for tensorflowjs==1.7.0
➜ python git:(master) ✗

2.1.2.3 Install tensorspace-converter

Please checkout my modified tensorspace-converter and have the python package installed. Please also keep an eye on my PR.

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
➜  tensorspace-converter git:(master) python setup.py install --user
running install
running bdist_egg
running egg_info
writing tensorspacejs.egg-info/PKG-INFO
writing dependency_links to tensorspacejs.egg-info/dependency_links.txt
writing entry points to tensorspacejs.egg-info/entry_points.txt
writing requirements to tensorspacejs.egg-info/requires.txt
writing top-level names to tensorspacejs.egg-info/top_level.txt
reading manifest template 'MANIFEST.in'
warning: no previously-included files matching '*' found under directory 'tensorspacejs/tfjs/node_modules'
warning: no previously-included files matching '*' found under directory 'tensorspacejs/tf/pb2json/node_modules'
writing manifest file 'tensorspacejs.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
creating build/bdist.linux-x86_64/egg
creating build/bdist.linux-x86_64/egg/tensorspacejs
copying build/lib/tensorspacejs/install.py -> build/bdist.linux-x86_64/egg/tensorspacejs
creating build/bdist.linux-x86_64/egg/tensorspacejs/krs
copying build/lib/tensorspacejs/krs/keras_conversion.py -> build/bdist.linux-x86_64/egg/tensorspacejs/krs
copying build/lib/tensorspacejs/krs/keras_model.py -> build/bdist.linux-x86_64/egg/tensorspacejs/krs
copying build/lib/tensorspacejs/krs/__init__.py -> build/bdist.linux-x86_64/egg/tensorspacejs/krs
creating build/bdist.linux-x86_64/egg/tensorspacejs/tf
copying build/lib/tensorspacejs/tf/frozen_model.py -> build/bdist.linux-x86_64/egg/tensorspacejs/tf
copying build/lib/tensorspacejs/tf/keras_model.py -> build/bdist.linux-x86_64/egg/tensorspacejs/tf
creating build/bdist.linux-x86_64/egg/tensorspacejs/tf/pb2json
copying build/lib/tensorspacejs/tf/pb2json/package.json -> build/bdist.linux-x86_64/egg/tensorspacejs/tf/pb2json
copying build/lib/tensorspacejs/tf/pb2json/pb2json_conversion.py -> build/bdist.linux-x86_64/egg/tensorspacejs/tf/pb2json
copying build/lib/tensorspacejs/tf/pb2json/README.md -> build/bdist.linux-x86_64/egg/tensorspacejs/tf/pb2json
creating build/bdist.linux-x86_64/egg/tensorspacejs/tf/pb2json/tools
copying build/lib/tensorspacejs/tf/pb2json/tools/compiled_api.js -> build/bdist.linux-x86_64/egg/tensorspacejs/tf/pb2json/tools
copying build/lib/tensorspacejs/tf/pb2json/tools/pb2json_converter.ts -> build/bdist.linux-x86_64/egg/tensorspacejs/tf/pb2json/tools
copying build/lib/tensorspacejs/tf/pb2json/__init__.py -> build/bdist.linux-x86_64/egg/tensorspacejs/tf/pb2json
copying build/lib/tensorspacejs/tf/saved_model.py -> build/bdist.linux-x86_64/egg/tensorspacejs/tf
copying build/lib/tensorspacejs/tf/tensorflow_conversion.py -> build/bdist.linux-x86_64/egg/tensorspacejs/tf
copying build/lib/tensorspacejs/tf/__init__.py -> build/bdist.linux-x86_64/egg/tensorspacejs/tf
creating build/bdist.linux-x86_64/egg/tensorspacejs/tfjs
creating build/bdist.linux-x86_64/egg/tensorspacejs/tfjs/app
copying build/lib/tensorspacejs/tfjs/app/Converter.js -> build/bdist.linux-x86_64/egg/tensorspacejs/tfjs/app
copying build/lib/tensorspacejs/tfjs/app/Summary.js -> build/bdist.linux-x86_64/egg/tensorspacejs/tfjs/app
copying build/lib/tensorspacejs/tfjs/main.js -> build/bdist.linux-x86_64/egg/tensorspacejs/tfjs
copying build/lib/tensorspacejs/tfjs/package.json -> build/bdist.linux-x86_64/egg/tensorspacejs/tfjs
copying build/lib/tensorspacejs/tfjs/tfjs_conversion.py -> build/bdist.linux-x86_64/egg/tensorspacejs/tfjs
creating build/bdist.linux-x86_64/egg/tensorspacejs/tfjs/utils
copying build/lib/tensorspacejs/tfjs/utils/Utils.js -> build/bdist.linux-x86_64/egg/tensorspacejs/tfjs/utils
creating build/bdist.linux-x86_64/egg/tensorspacejs/tfjs/wrapper
copying build/lib/tensorspacejs/tfjs/wrapper/ModelWrapper.js -> build/bdist.linux-x86_64/egg/tensorspacejs/tfjs/wrapper
copying build/lib/tensorspacejs/tfjs/__init__.py -> build/bdist.linux-x86_64/egg/tensorspacejs/tfjs
copying build/lib/tensorspacejs/tsp_converters.py -> build/bdist.linux-x86_64/egg/tensorspacejs
creating build/bdist.linux-x86_64/egg/tensorspacejs/utility
copying build/lib/tensorspacejs/utility/file_utility.py -> build/bdist.linux-x86_64/egg/tensorspacejs/utility
copying build/lib/tensorspacejs/utility/__init__.py -> build/bdist.linux-x86_64/egg/tensorspacejs/utility
copying build/lib/tensorspacejs/version.py -> build/bdist.linux-x86_64/egg/tensorspacejs
copying build/lib/tensorspacejs/__init__.py -> build/bdist.linux-x86_64/egg/tensorspacejs
creating build/bdist.linux-x86_64/egg/tensorspacejs/__pycache__
copying build/lib/tensorspacejs/__pycache__/version.cpython-36.pyc -> build/bdist.linux-x86_64/egg/tensorspacejs/__pycache__
copying build/lib/tensorspacejs/__pycache__/__init__.cpython-36.pyc -> build/bdist.linux-x86_64/egg/tensorspacejs/__pycache__
byte-compiling build/bdist.linux-x86_64/egg/tensorspacejs/install.py to install.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/tensorspacejs/krs/keras_conversion.py to keras_conversion.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/tensorspacejs/krs/keras_model.py to keras_model.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/tensorspacejs/krs/__init__.py to __init__.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/tensorspacejs/tf/frozen_model.py to frozen_model.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/tensorspacejs/tf/keras_model.py to keras_model.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/tensorspacejs/tf/pb2json/pb2json_conversion.py to pb2json_conversion.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/tensorspacejs/tf/pb2json/__init__.py to __init__.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/tensorspacejs/tf/saved_model.py to saved_model.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/tensorspacejs/tf/tensorflow_conversion.py to tensorflow_conversion.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/tensorspacejs/tf/__init__.py to __init__.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/tensorspacejs/tfjs/tfjs_conversion.py to tfjs_conversion.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/tensorspacejs/tfjs/__init__.py to __init__.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/tensorspacejs/tsp_converters.py to tsp_converters.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/tensorspacejs/utility/file_utility.py to file_utility.cpython-36.pyc
byte-compiling build/bdist.linux-x86_64/egg/tensorspacejs/utility/__init__.py to __init__.cpython-36.pyc
creating build/bdist.linux-x86_64/egg/EGG-INFO
copying tensorspacejs.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
copying tensorspacejs.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying tensorspacejs.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying tensorspacejs.egg-info/entry_points.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying tensorspacejs.egg-info/requires.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying tensorspacejs.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
zip_safe flag not set; analyzing archive contents...
tensorspacejs.__pycache__.install.cpython-36: module references __file__
tensorspacejs.__pycache__.tsp_converters.cpython-36: module references __file__
tensorspacejs.tf.pb2json.__pycache__.pb2json_conversion.cpython-36: module references __file__
tensorspacejs.tfjs.__pycache__.tfjs_conversion.cpython-36: module references __file__
creating 'dist/tensorspacejs-0.6.1-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 tensorspacejs-0.6.1-py3.6.egg
creating ~/.local/lib/python3.6/site-packages/tensorspacejs-0.6.1-py3.6.egg
Extracting tensorspacejs-0.6.1-py3.6.egg to ~/.local/lib/python3.6/site-packages
Adding tensorspacejs 0.6.1 to easy-install.pth file
Installing tensorspacejs_converter script to ~/.local/bin

Installed ~/.local/lib/python3.6/site-packages/tensorspacejs-0.6.1-py3.6.egg
Processing dependencies for tensorspacejs==0.6.1
Searching for tensorflow==2.1.0
Best match: tensorflow 2.1.0
Adding tensorflow 2.1.0 to easy-install.pth file
Installing estimator_ckpt_converter script to ~/.local/bin
Installing saved_model_cli script to ~/.local/bin
Installing tensorboard script to ~/.local/bin
Installing tf_upgrade_v2 script to ~/.local/bin
Installing tflite_convert script to ~/.local/bin
Installing toco script to ~/.local/bin
Installing toco_from_protos script to ~/.local/bin

Using ~/.local/lib/python3.6/site-packages
Searching for Keras==2.3.1
Best match: Keras 2.3.1
Processing Keras-2.3.1-py3.6.egg
Keras 2.3.1 is already the active version in easy-install.pth

Using ~/.local/lib/python3.6/site-packages/Keras-2.3.1-py3.6.egg
Searching for tensorflowjs==1.7.2
Best match: tensorflowjs 1.7.2
Processing tensorflowjs-1.7.2-py3.6.egg
tensorflowjs 1.7.2 is already the active version in easy-install.pth
Installing tensorflowjs_converter script to ~/.local/bin

Using ~/.local/lib/python3.6/site-packages/tensorflowjs-1.7.2-py3.6.egg
Searching for tensorboard==2.1.1
Best match: tensorboard 2.1.1
Processing tensorboard-2.1.1-py3.6.egg
tensorboard 2.1.1 is already the active version in easy-install.pth
Installing tensorboard script to ~/.local/bin

Using ~/.local/lib/python3.6/site-packages/tensorboard-2.1.1-py3.6.egg
Searching for Keras-Preprocessing==1.1.0
Best match: Keras-Preprocessing 1.1.0
Adding Keras-Preprocessing 1.1.0 to easy-install.pth file

Using ~/.local/lib/python3.6/site-packages
Searching for grpcio==1.28.1
Best match: grpcio 1.28.1
Adding grpcio 1.28.1 to easy-install.pth file

Using ~/.local/lib/python3.6/site-packages
Searching for termcolor==1.1.0
Best match: termcolor 1.1.0
Adding termcolor 1.1.0 to easy-install.pth file

Using ~/.local/lib/python3.6/site-packages
Searching for six==1.14.0
Best match: six 1.14.0
Adding six 1.14.0 to easy-install.pth file

Using ~/.local/lib/python3.6/site-packages
Searching for protobuf==3.11.3
Best match: protobuf 3.11.3
Adding protobuf 3.11.3 to easy-install.pth file

Using ~/.local/lib/python3.6/site-packages
Searching for wrapt==1.12.1
Best match: wrapt 1.12.1
Adding wrapt 1.12.1 to easy-install.pth file

Using ~/.local/lib/python3.6/site-packages
Searching for opt-einsum==3.2.1
Best match: opt-einsum 3.2.1
Adding opt-einsum 3.2.1 to easy-install.pth file

Using ~/.local/lib/python3.6/site-packages
Searching for google-pasta==0.2.0
Best match: google-pasta 0.2.0
Adding google-pasta 0.2.0 to easy-install.pth file

Using ~/.local/lib/python3.6/site-packages
Searching for scipy==1.4.1
Best match: scipy 1.4.1
Adding scipy 1.4.1 to easy-install.pth file

Using ~/.local/lib/python3.6/site-packages
Searching for h5py==2.10.0
Best match: h5py 2.10.0
Adding h5py 2.10.0 to easy-install.pth file

Using ~/.local/lib/python3.6/site-packages
Searching for absl-py==0.9.0
Best match: absl-py 0.9.0
Adding absl-py 0.9.0 to easy-install.pth file

Using ~/.local/lib/python3.6/site-packages
Searching for wheel==0.34.2
Best match: wheel 0.34.2
Adding wheel 0.34.2 to easy-install.pth file
Installing wheel script to ~/.local/bin

Using ~/.local/lib/python3.6/site-packages
Searching for gast==0.3.3
Best match: gast 0.3.3
Adding gast 0.3.3 to easy-install.pth file

Using ~/.local/lib/python3.6/site-packages
Searching for numpy==1.18.2
Best match: numpy 1.18.2
Adding numpy 1.18.2 to easy-install.pth file
Installing f2py script to ~/.local/bin
Installing f2py3 script to ~/.local/bin
Installing f2py3.6 script to ~/.local/bin

Using ~/.local/lib/python3.6/site-packages
Searching for tensorflow-estimator==2.1.0
Best match: tensorflow-estimator 2.1.0
Adding tensorflow-estimator 2.1.0 to easy-install.pth file

Using ~/.local/lib/python3.6/site-packages
Searching for astunparse==1.6.3
Best match: astunparse 1.6.3
Adding astunparse 1.6.3 to easy-install.pth file

Using ~/.local/lib/python3.6/site-packages
Searching for Keras-Applications==1.0.8
Best match: Keras-Applications 1.0.8
Adding Keras-Applications 1.0.8 to easy-install.pth file

Using ~/.local/lib/python3.6/site-packages
Searching for PyYAML==5.3.1
Best match: PyYAML 5.3.1
Adding PyYAML 5.3.1 to easy-install.pth file

Using ~/.local/lib/python3.6/site-packages
Searching for tensorflow-hub==0.8.0
Best match: tensorflow-hub 0.8.0
Adding tensorflow-hub 0.8.0 to easy-install.pth file
Installing make_image_classifier script to ~/.local/bin
Installing make_nearest_neighbour_index script to ~/.local/bin

Using ~/.local/lib/python3.6/site-packages
Searching for Werkzeug==1.0.1
Best match: Werkzeug 1.0.1
Adding Werkzeug 1.0.1 to easy-install.pth file

Using ~/.local/lib/python3.6/site-packages
Searching for setuptools==46.1.3
Best match: setuptools 46.1.3
Adding setuptools 46.1.3 to easy-install.pth file
Installing easy_install script to ~/.local/bin
Installing easy_install-3.8 script to ~/.local/bin

Using ~/.local/lib/python3.6/site-packages
Searching for requests==2.23.0
Best match: requests 2.23.0
Adding requests 2.23.0 to easy-install.pth file

Using ~/.local/lib/python3.6/site-packages
Searching for Markdown==3.2.1
Best match: Markdown 3.2.1
Adding Markdown 3.2.1 to easy-install.pth file
Installing markdown_py script to ~/.local/bin

Using ~/.local/lib/python3.6/site-packages
Searching for google-auth==1.14.0
Best match: google-auth 1.14.0
Adding google-auth 1.14.0 to easy-install.pth file

Using ~/.local/lib/python3.6/site-packages
Searching for google-auth-oauthlib==0.4.1
Best match: google-auth-oauthlib 0.4.1
Adding google-auth-oauthlib 0.4.1 to easy-install.pth file
Installing google-oauthlib-tool script to ~/.local/bin

Using ~/.local/lib/python3.6/site-packages
Searching for chardet==3.0.4
Best match: chardet 3.0.4
Adding chardet 3.0.4 to easy-install.pth file
Installing chardetect script to ~/.local/bin

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

Using ~/.local/lib/python3.6/site-packages
Searching for idna==2.9
Best match: idna 2.9
Adding idna 2.9 to easy-install.pth file

Using ~/.local/lib/python3.6/site-packages
Searching for urllib3==1.25.9
Best match: urllib3 1.25.9
Adding urllib3 1.25.9 to easy-install.pth file

Using ~/.local/lib/python3.6/site-packages
Searching for cachetools==4.1.0
Best match: cachetools 4.1.0
Adding cachetools 4.1.0 to easy-install.pth file

Using ~/.local/lib/python3.6/site-packages
Searching for rsa==4.0
Best match: rsa 4.0
Adding rsa 4.0 to easy-install.pth file
Installing pyrsa-decrypt script to ~/.local/bin
Installing pyrsa-encrypt script to ~/.local/bin
Installing pyrsa-keygen script to ~/.local/bin
Installing pyrsa-priv2pub script to ~/.local/bin
Installing pyrsa-sign script to ~/.local/bin
Installing pyrsa-verify script to ~/.local/bin

Using ~/.local/lib/python3.6/site-packages
Searching for pyasn1-modules==0.2.8
Best match: pyasn1-modules 0.2.8
Adding pyasn1-modules 0.2.8 to easy-install.pth file

Using ~/.local/lib/python3.6/site-packages
Searching for requests-oauthlib==1.3.0
Best match: requests-oauthlib 1.3.0
Adding requests-oauthlib 1.3.0 to easy-install.pth file

Using ~/.local/lib/python3.6/site-packages
Searching for pyasn1==0.4.8
Best match: pyasn1 0.4.8
Adding pyasn1 0.4.8 to easy-install.pth file

Using ~/.local/lib/python3.6/site-packages
Searching for oauthlib==3.1.0
Best match: oauthlib 3.1.0
Adding oauthlib 3.1.0 to easy-install.pth file

Using ~/.local/lib/python3.6/site-packages
Finished processing dependencies for tensorspacejs==0.6.1

2.1.2.4 Try tensorspacejs_converter Again

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
➜  WebTensorspace tensorspacejs_converter \
--input_model_from="tensorflow" \
--input_model_format="tf_keras" \
--output_layer_names="padding_1,conv_1,maxpool_1,conv_2,maxpool_2,dense_1,dense_2,softmax" \
./model/tf_keras_model.h5 \
./model/convertedModel
Using TensorFlow backend.
2020-04-17 04:45:23.473683: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcuda.so.1
2020-04-17 04:45:23.477188: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:981] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2020-04-17 04:45:23.477770: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1558] Found device 0 with properties:
pciBusID: 0000:01:00.0 name: GeForce GTX 980M computeCapability: 5.2
coreClock: 1.1265GHz coreCount: 12 deviceMemorySize: 3.94GiB deviceMemoryBandwidth: 149.31GiB/s
2020-04-17 04:45:23.478004: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcudart.so.10.2
2020-04-17 04:45:23.479508: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcublas.so.10
2020-04-17 04:45:23.480978: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcufft.so.10
2020-04-17 04:45:23.481245: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcurand.so.10
2020-04-17 04:45:23.482737: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcusolver.so.10
2020-04-17 04:45:23.483660: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcusparse.so.10
2020-04-17 04:45:23.487100: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcudnn.so.7
2020-04-17 04:45:23.487273: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:981] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2020-04-17 04:45:23.487902: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:981] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2020-04-17 04:45:23.488310: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1700] Adding visible gpu devices: 0
2020-04-17 04:45:23.488621: I tensorflow/core/platform/cpu_feature_guard.cc:143] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE3 SSE4.1 SSE4.2 AVX AVX2 FMA
2020-04-17 04:45:23.511713: I tensorflow/core/platform/profile_utils/cpu_utils.cc:102] CPU Frequency: 2599990000 Hz
2020-04-17 04:45:23.512333: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x5bc9f30 initialized for platform Host (this does not guarantee that XLA will be used). Devices:
2020-04-17 04:45:23.512354: I tensorflow/compiler/xla/service/service.cc:176] StreamExecutor device (0): Host, Default Version
2020-04-17 04:45:23.553407: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:981] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2020-04-17 04:45:23.553764: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x5c320e0 initialized for platform CUDA (this does not guarantee that XLA will be used). Devices:
2020-04-17 04:45:23.553782: I tensorflow/compiler/xla/service/service.cc:176] StreamExecutor device (0): GeForce GTX 980M, Compute Capability 5.2
2020-04-17 04:45:23.553969: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:981] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2020-04-17 04:45:23.554208: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1558] Found device 0 with properties:
pciBusID: 0000:01:00.0 name: GeForce GTX 980M computeCapability: 5.2
coreClock: 1.1265GHz coreCount: 12 deviceMemorySize: 3.94GiB deviceMemoryBandwidth: 149.31GiB/s
2020-04-17 04:45:23.554271: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcudart.so.10.2
2020-04-17 04:45:23.554302: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcublas.so.10
2020-04-17 04:45:23.554315: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcufft.so.10
2020-04-17 04:45:23.554344: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcurand.so.10
2020-04-17 04:45:23.554389: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcusolver.so.10
2020-04-17 04:45:23.554413: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcusparse.so.10
2020-04-17 04:45:23.554442: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcudnn.so.7
2020-04-17 04:45:23.554519: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:981] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2020-04-17 04:45:23.554755: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:981] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2020-04-17 04:45:23.554956: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1700] Adding visible gpu devices: 0
2020-04-17 04:45:23.555015: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcudart.so.10.2
2020-04-17 04:45:23.555794: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1099] Device interconnect StreamExecutor with strength 1 edge matrix:
2020-04-17 04:45:23.555806: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1105] 0
2020-04-17 04:45:23.555830: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1118] 0: N
2020-04-17 04:45:23.555939: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:981] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2020-04-17 04:45:23.556211: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:981] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2020-04-17 04:45:23.556465: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1244] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 133 MB memory) -> physical GPU (device: 0, name: GeForce GTX 980M, pci bus id: 0000:01:00.0, compute capability: 5.2)
Preprocessing hdf5 combined model...
Loading .h5 model into memory...
WARNING:tensorflow:From /home/longervision/.local/lib/python3.6/site-packages/tensorflow/python/ops/resource_variable_ops.py:1658: calling BaseResourceVariable.__init__ (from tensorflow.python.ops.resource_variable_ops) with constraint is deprecated and will be removed in a future version.
Instructions for updating:
If using Keras pass *_constraint arguments to layers.
Generating multi-output encapsulated model...
Saving temp multi-output .h5 model...
Converting .h5 to web friendly format...
Deleting temp .h5 model...
Mission Complete!!!
➜ WebTensorspace ls model/convertedModel
group1-shard1of1.bin model.json

2.1.3 index.html

2.1.3.1 helloworld-empty

Let's copy and paste TensorSpace's Example helloworld-empty.html and do some trivial modification for 3D visualization, as follows:

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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>AI Model Visualization By Tensorspace - 3D Interactive</title>
<meta name="author" content="Longer Vision / https://longervision.github.io/2020/04/17/AI/Visualization/model-visualization-tensorspace-3D-interactive/">

<script src="./lib/three.min.js"></script>
<script src="./lib/tween.cjs.js"></script>
<script src="./lib/tf.min.js"></script>
<script src="./lib/TrackballControls.js"></script>
<script src="./lib/tensorspace.min.js"></script>
<script src="./lib/jquery.min.js"></script>

<style>

html, body {
margin: 0;
padding: 0;
width: 100%;
height: 100%;
}

#container {
width: 100%;
height: 100%;
}

</style>

</head>

<body>

<div id="container"></div>

<script>

$(function() {

let modelContainer = document.getElementById( "container" );
let model = new TSP.models.Sequential( modelContainer );

model.add( new TSP.layers.GreyscaleInput( { shape: [ 28, 28 ] } ) );
model.add( new TSP.layers.Padding2d( { padding: [ 2, 2 ] } ) );
model.add( new TSP.layers.Conv2d( { kernelSize: 5, filters: 6, strides: 1 } ) );
model.add( new TSP.layers.Pooling2d( { poolSize: [ 2, 2 ], strides: [ 2, 2 ] } ) );
model.add( new TSP.layers.Conv2d( { kernelSize: 5, filters: 16, strides: 1 } ) );
model.add( new TSP.layers.Pooling2d( { poolSize: [ 2, 2 ], strides: [ 2, 2 ] } ) );
model.add( new TSP.layers.Dense( { units: 120 } ) );
model.add( new TSP.layers.Dense( { units: 84 } ) );
model.add( new TSP.layers.Output1d( {
units: 10,
outputs: [ "0", "1", "2", "3", "4", "5", "6", "7", "8", "9" ]
} ) );

model.init( function() {
console.log( "Hello World from TensorSpace!" );
} );

} );

</script>

</body>
</html>