TensorFlow

TensorFlow

  • 安装
1
pip install tensorflow==1.12 -i https://mirrors.aliyun.com/pypi/simple

TensorFlow结构分析

TensorFlow程序通常被组织成一个构建图阶段和一个执行图阶段

  • 构建阶段:数据与操作的执行步骤被描述成一个图

  • 执行阶段:使用会话执行构建好的图中的操作

  • 图和会话:

    • 图(graph):这是TensorFlow将计算表示为指令之间的依赖关系的一种表示法
    • 会话(session):TensorFlow跨一个或多个本地或远程设备运行数据流图的机制
  • 张量(Tensor):TensorFlow中的基本数据对象

  • 节点(operation):提供图当中执行的操作

图与TensorBoard

什么是图结构

图包含了一组tf.Operation代表的计算单元对象和tf.Tensor代表的计算单元之间流动的数据。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
import tensorflow as tf
# 获取默认图
tf.get_default_graph()
# 通过Tensor获取该元素属于哪个图
tensor.graph()
# 新建图并对图进行操作
new_g = tf.Graph()
with new_g.as_default():
new_a = tf.constant(10)
new_b = tf.constant(20)
new_c = tf.add(new_a,new_b)
with tf.Session(graph=new_g) as sess:
sum_new = sess.run(new_c)
print(sum_new)

TensorBoard:可视化工具

TensorFlow可用于训练大规模深度神经网络,所需要的计算次数、时间往往都很长,而为了方便对TensorFlow程序的调试和优化,TensorFlow提供了TensorBoard可视化工具

  • 开启TensorBoard步骤

    • TensorBoard通过读取TensorFLow的事件文件来运行,需要将数据生成一个序列化的Summary protobuf对象
    1
    tf.summary.FileWriter('/tmp/summary/', graph=sess.graph)
    • 在这个指定的目录下会生一个event文件,器格式名如下
    1
    events.out.tfevents.{timestamp}.{hostname}
    • 启动TensorBoard
    1
    tensorboard --logdir="/tmp/summary/"
    • 然后再浏览器中打开127.0.0.1:6006,就能看到TensorBoard网页了
  • 收集其他变量

    • 收集0维值
      • tf.summary.scalar(“变量名”,变量)
    • 收集高维值
      • tf.summary.histogram(“变量名”,变量)
    • 整合结果
      • merge = tf.summary.merge_all()
    • 获取值
      • sum_mary = sess.run(merge)
    • 写入值
      • filewriter.add_summary(sum_mary,i)

OP

OP是一个操作对象(Operation),是TensorFlow图中的一个节点,可以接收0个或多个输入Tensor,并且可以输出0个或多个Tensor,Operation对象是通过op构造函数(tf.add())创建的。

OP运算包括下面这些:

类型 实例
标量运算 add,sub,mul,div,exp,log,greater,less,equal
向量运算 concat,slice,splot,constant,rank,shape,shuffle
矩阵运算 matmul,matrixinverse,matrixdateminant
带状态运算 Variable,assgin,assginadd
神经网络组件 softmax,singmoid,relu,convolution,max_pool
存储、恢复 Save,Restroe
队列及同步运算 Enqueue,Dequeue,MutexAcquire,MutexRelease
控制流 Merge,Switch,Enter,Leave,Nextlteration

会话

一个运行TensorFlow operation的类,会话包含以下两种开启方式

  • tf.Session:用于完整的程序中
  • tf.InteractiveSession:用于交互式上下文中的TensorFlow,例如shell

tf.Session(target=””,graph=None,config=None)

  • target:如果将次参数留空(默认设置),会话将仅使用本地计算机设备,也可以指定远程设备。
  • graph:默认情况下,绑定当前程序的默认图
  • config:此参数允许您指定一个 tf.ConfigProto 以便控制会话的行为。例如,ConfigProto协议用于打印设备使用信息

run(fetches,feed_dict=None,options=None,run_metadata=None)

  • 通过sess.run()来运行operation;多个以列表输入,返回结果也是多个
  • fetches:一个或多个operation;多个以列表输入,返回结果也是多个
  • feed_dict:参数允许调用者覆盖图中张量的值,运行时赋值
    • 与tf.placeholder搭配使用,会检查值得形状是否与占位符兼容
1
2
3
4
5
6
7
8
9
10
import tensorflow as tf
# 定义占位符tensor
a = tf.placeholder(tf.float32)
b = tf.placeholder(tf.float32)
sum_ab = tf.add(a, b)

# 开启会话
with tf.Session() as sess:
sum_ab_value = sess.run(sum_ab,feed_dict={a:3.0,b:4.0})
print(sum_ab_value)

张量

TensorFlow的张量就时一个n维数组,类型维tf.Tensor。Tensor具有两个重要的属性

  • type:数据类型

  • shape:形状

创建张量

创建固定值张量

  • tf.zeros(shape,dtype=tf.float32,name=None)
    • 创建一个shape形状,类型为tf.float32,值全为0的张量
  • tf.zeros_like(tensor)
    • 根据已有tensor类型、形状,创建一个全为0的张量
  • tf.ones(shape,dtype=tf.float32,name=None)
    • 创建一个shape形状,类型为tf.float32,值全为1的张量
  • tf.ones_like(tensor)
    • 根据已有tensor类型、形状,创建一个全为1的张量
  • tf.fill(shape,value,name=None)
    • 创建一个形状为shape,值为value的张量
  • tf.constant(value,dtype=None,shape=None,name=”Const”)
    • 创建一个常数张量

创建随机张量

  • tf.random_normal(shape,mean=0.0,stddev=1.0,dtype=tf.float32)
    • 从标准正太分布随机输出值,构成一个shape形状的矩阵

张量的变换

  • 类型改变

    • tf.cast(tensor,dtype,name=None)
      • tensor:输入的tensor,
      • dtype:转换后的tensor类型
  • 形状改变

    • 静态形状改变:只能更改还没有定义的形状如tf.placeholder(tf.float32,shape=[None,None])
      • tensor.set_shape(shape)
    • 动态形状改变:可以改变tensor的形状,但是改变之后的元素总数得相同
      • tf.reshape(tensor,shape)
  • 张量的运算

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
import tensorflow as tf
ts1 = tf.constant(1.0)
ts1 = tf.constant(2.0)
# 加
ts_add = tf.add(ts1, ts2)
# 减
ts_sub = tf.subtract(ts1, ts2)
# 乘
ts_mul = tf.multiply(ts1, ts2)
# 除
ts_div = tf.divide(ts1, ts2)
# 取余
ts_mod = tf.mod(ts1, ts2)

# 绝对值
ts_abs = tf.abs(ts1)
# 取反
ts_neg = tf.negative(ts1)
# 四舍五入
ts_rou = tf.round(ts1)
# 取符号
ts_sig = tf.sign(ts1)
# 取倒数
ts_rec = tf.reciprocal(ts1)
# 向上取整
ts_cei = tf.ceil(ts1)
# 向下取整
ts_flo = tf.floor(ts1)
# 取最接近的整数
ts_int = tf.rint(ts1)
# 取最大值
ts_max = tf.maximum(ts1, ts2)
# 取最小值
ts_min = tf.minimum(ts1, ts2)

# 平方
ts_squ = tf.square(ts1)
# 开根号
ts_sqr = tf.sqrt(ts1)
# ts1^ts2,如果两个都是tensor就对应位置次幂
ts_pow = tf.pow(ts1, ts2)
# e^ts1
ts_exp = tf.exp(ts1)
# log(ts1),e为底
ts_log = tf.log(ts1)

# cos
ts_cos = tf.cos(ts1)
# sin
ts_sin = tf.sin(ts1)
# tan
ts_tan = tf.tan(ts1)
# cos是已知角度求值,acos是已知值求角度
ts_aco = tf.acos(ts1)
# asin
ts_asi = tf.asin(ts1)
# atan
ts_ata = tf.atan(ts1)

变量OP

tf.Variable(initial_value=None,trainable=True,collections=None,name=None)

  • initial_value:初始化的值
  • trainable:是否被训练
  • collections:新变量将添加到列出的图的集合中collections,默认为[GraphKeys.GLOBAL_VARIABLES],如果trainable是True变量也添加到图形集合GraphKeys.TRAINABLE_VARIABLES
  • 特点:该变量可以存储到硬盘上;可以修改值,可以指定被训练
  • 变量需要显式初始化,才能运行值
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
def variable_demo():
# 定义变量
a = tf.Variable(initial_value=30)
b = tf.Variable(initial_value=40)
sum = tf.add(a, b)

# 初始化变量
init = tf.global_variavles_initializer()

# 开启会话
with tf.Session() as sess:
# 变量初始化
sess.run(init)
print("sum:\n",sess.run(sum))
return None

使用tf.variable_scope()修改变量的命名空间

1
2
3
4
5
6
7
8
with tf.variable_scope("name"):
var = tf.Variable(name="var",initial_value=[4],dtype=tf.float32)
var_value = tf.Variable(name="var",initial_value=[4],dtype=tf.float32)
print(var)
print(var_1)

<tf.Variable 'name/var:0' shape=() dtype=float32_ref>
<tf.Variable 'name/var_1:0' shape=() dtype=float32_ref>

模型保存于加载

1
2
3
4
5
6
7
8
9
10
11
12
13
# 创建实例
saver = tf.train.Saver()
# 保存模型
saver.save(sess, "./model/Lr.ckpt")
# 判断模式是否存在
checkpoint = tf.train.latest_checkpoint('./model/')
# 加载模型,或者直接替换成路径
saver.restore(sess, checkpoint)

# 打印模型图片
from tensorflow.keras.utils import plot_model
plot_model(model, to_file='./model.png', show_shapes=True, show_dtype=True, expand_nested=True)

常用api

1
2
parameter = model.get_layer(i).get_weights()# 获取该模型第i层的权重
model.get_layer(i).set_weights(parameter)# 获取老模型参更新到新模型(当前层的权重个数一致时可以)

分布式训练

1
2
3
4
5
6
7
8
9
10
11
12
13
14
tf.debugging.set_log_device_placement(True)   #打印信息的显示某个变量在哪个设备上设置为True
tf.config.experimental.set_visible_devices(gpu_list[1], "GPU") # 设置哪些GPU设备部对当前进程可见的
gpu_list = tf.config.experimental.list_logical_devices("GPU") # 获取所有的逻辑设备
log_gpu_list = tf.config.experimental.list_physical_devices("GPU") # 获取所有的物理设备
tf.config.experimental.set_memory_growth(log_gpu_list[1],True) # 设置该GPU内存为自增,就是用多少就占用多少内存
tf.config.experimental.set_virtual_device_configuration(log_gpu_list[2], [tf.config.experimental.VirtualDeviceConfiguration(memory_limit=1024)]) # 把一个物理设备分成多个 逻辑设备(这里分成了一个1024M的逻辑GPU)
tf.config.set_soft_device_placement(True) # 可以在保持正确性的前提下,自动把任务分到多个设备上

os.environ["CUDA_VISIBLE_DEVICES"] = "-1"
import os
import tensorflow as tf
gpu_list = tf.config.experimental.list_physical_devices("GPU")
for i in gpu_list:
tf.config.experimental.set_memory_growth(i,True)

分布式策略

MirroredStrategy

  • 进行的是同步式分布式训练
  • 适用于一机多卡的情况
  • 数据并行:
    • Batch数据切分成N份分发给每个GPU
    • 然后聚合梯度后来更新每个GPU的参数
  • 缺点:更新一轮的速度取决于最慢的gpu
1
2
3
4
5
6
7
strategy = tf.distribute.MirroredStrategy()

with strategy.scope():
# 定义模型
model = keras.models.Sequential()
model.add(Conv2D(filters=128,kernel_size=3,padding="same",activation="relu",input_shape=(100,)))
model.compile(loss="sparse_categoriccal_crossentropy",optimizer="sgd",metrics=["accuracy"])

CentralStorageStrategy

  • MirroredStrategy的一个变种
  • 把模型参数只单独存储在一CPU上(如果只有一快GPU将存储在GPU上)
  • 其他还是一样的

MultiworkerMirroredStrtrgy

  • 类似于MirroredStrategy
  • 适用于多机多卡的形式
1

TPUStrategy

  • 类似于MirroredStrategy
  • 针对TPU的一种策略

ParameterServerStrategy

  • 异步分布式
  • 更加适用于大规模分布式系统
  • 机器分为Parameter Server和worker两类
    • Parameter Server:负责整合梯度更新参数,更新参数
    • worker:负责计算梯度,训练网络

img

同步与异步的优劣

  • 多机多卡
    • 异步可以避免短板效应
  • 一机多卡
    • 同步可以避免过多的通信
  • 异步计算会增加模型的泛化能力
    • 异步不是严格正确的,所以模型更容忍错误

ParameterServerStrategy

定义ps节点

1
2
3
4
5
6
7
8
9
10
11
12
# tf2.0需先配置cluster_resolver(即TF_CONFIG),否则报错
import json
os.environ["TF_CONFIG"] = json.dumps({
"cluster": {
"chief":["127.0.0.1:5000"],#调度节点
"worker": ["127.0.0.1:5001"], #计算节点
"ps": ["127.0.0.1:5002"]#参数服务器节点,可不必使用GPU
},
"task": {"type": "ps", "index": 0} #定义本进程为worker节点,即["127.0.0.1:5001"]为计算节点
})
#定义ParameterServerStrategy策略即可
strategy = tf.distribute.experimental.ParameterServerStrategy()

定义调度节点

1
2
3
4
5
6
7
8
9
10
11
12
# tf2.0需先配置cluster_resolver(即TF_CONFIG),否则报错
import json
os.environ["TF_CONFIG"] = json.dumps({
"cluster": {
"chief":["127.0.0.1:5000"],#调度节点
"worker": ["127.0.0.1:5001"], #计算节点
"ps": ["127.0.0.1:5002"]#参数服务器节点,可不必使用GPU
},
"task": {"type": "chief", "index": 0} #定义本进程为worker节点,即["127.0.0.1:5001"]为计算节点
})
#定义ParameterServerStrategy策略即可
strategy = tf.distribute.experimental.ParameterServerStrategy()

定义计算节点

1
2
3
4
5
6
7
8
9
10
11
12
# tf2.0需先配置cluster_resolver(即TF_CONFIG),否则报错
import json
os.environ["TF_CONFIG"] = json.dumps({
"cluster": {
"chief":["127.0.0.1:5000"],#调度节点
"worker": ["127.0.0.1:5001"], #计算节点
"ps": ["127.0.0.1:5002"]#参数服务器节点,可不必使用GPU
},
"task": {"type": "worker", "index": 0} #定义本进程为worker节点,即["127.0.0.1:5001"]为计算节点
})
#定义ParameterServerStrategy策略即可
strategy = tf.distribute.experimental.ParameterServerStrategy()

定义模型

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
LEARNING_RATE = 1e-3
BATCH_SIZE=32
def model_fn(features, labels, mode):
model = tf.keras.Sequential([
tf.keras.layers.Conv2D(32, 3, activation='relu', input_shape=(28, 28, 1)),
tf.keras.layers.MaxPooling2D(),
tf.keras.layers.Flatten(),
tf.keras.layers.Dense(64, activation='relu'),
tf.keras.layers.Dense(10, activation='softmax')
])
logits = model(features, training=False)

if mode == tf.estimator.ModeKeys.PREDICT:
predictions = {'logits': logits}
return tf.estimator.EstimatorSpec(labels=labels, predictions=predictions)

optimizer = tf.compat.v1.train.GradientDescentOptimizer(
learning_rate=LEARNING_RATE)
loss = tf.keras.losses.SparseCategoricalCrossentropy(
from_logits=True, reduction=tf.keras.losses.Reduction.NONE)(labels, logits)
loss = tf.reduce_sum(loss) * (1. / BATCH_SIZE)
if mode == tf.estimator.ModeKeys.EVAL:
return tf.estimator.EstimatorSpec(mode, loss=loss)

return tf.estimator.EstimatorSpec(
mode=mode,
loss=loss,
train_op=optimizer.minimize(
loss, tf.compat.v1.train.get_or_create_global_step()))

定义步数

1
2
3
4
5
#定义多少步保存模型,多少步打印日志信息等,注意,分布式训练关键在于-train_distribute=strategy
run_config = tf.estimator.RunConfig(keep_checkpoint_max=1,
log_step_count_steps=10,train_distribute=strategy)
#输入model_fn,模型保存路径
classifier = tf.estimator.Estimator(model_fn=model_fn,model_dir="./model",config=run_config)

启动

1
2
3
4
5
tf.estimator.train_and_evaluate(
classifier,
train_spec=tf.estimator.TrainSpec(input_fn=lambda :input_fn(train_images,train_labels,tf.estimator.ModeKeys.TRAIN, 256),max_steps=30000),
eval_spec=tf.estimator.EvalSpec(input_fn=lambda :input_fn(test_images,test_labels,tf.estimator.ModeKeys.TRAIN, 256),steps=300)
)

tf_serving

修改源码编译运行

1
2
3
4
5
6
7
# 拉取编译环境latest-devel,也可以是对应版本的
docker pull tensorflow/serving:latest-devel
# 修改需要修改的地方
# 编译 可能会失败多试几次
bazel build -c opt tensorflow_serving/...
# 编译完成 文件再bazel-bin/tensorflow_serving/model_servers/tensorflow_model_server目录下
# 可以把对应tensorflow_model_server转到tensorflow/serving对应版本的tensorflow/serving镜像中

把模型保存为bp格式

1
2
3
4
tf.keras.models.save_model(model,
'./tf_serving_model/hert_model/1',
overwrite=True,include_optimizer=True,save_format=None,
signatures=None,options=None)

启动docker

1
2
# 8501为http,8500为grpc
docker run -p 8501:8501 --mount type=bind,source=/root/zoubin/tf_serving_model/hert_model,target=/models/heart_model -e MODEL_NAME=heart_model -t tensoreflow/serving

查看模型输入结构

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
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
(test) bufan@bufandeMacBook-Pro tf_serving_model % saved_model_cli show --dir ./hert_model/1 --all

MetaGraphDef with tag-set: 'serve' contains the following SignatureDefs:

signature_def['__saved_model_init_op']:
The given SavedModel SignatureDef contains the following input(s):
The given SavedModel SignatureDef contains the following output(s):
outputs['__saved_model_init_op'] tensor_info:
dtype: DT_INVALID
shape: unknown_rank
name: NoOp
Method name is:

signature_def['serving_default']:
The given SavedModel SignatureDef contains the following input(s):
inputs['ad_creativeType'] tensor_info:
dtype: DT_INT32
shape: (-1, 3)
name: serving_default_ad_creativeType:0
inputs['ad_designStyle'] tensor_info:
dtype: DT_INT32
shape: (-1, 1)
name: serving_default_ad_designStyle:0
inputs['ad_id'] tensor_info:
dtype: DT_INT32
shape: (-1, 1)
name: serving_default_ad_id:0
inputs['ad_mainColor'] tensor_info:
dtype: DT_INT32
shape: (-1, 1)
name: serving_default_ad_mainColor:0
inputs['afternoon_avgta'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_afternoon_avgta:0
inputs['afternoon_maxta'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_afternoon_maxta:0
inputs['afternoon_minta'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_afternoon_minta:0
inputs['afternoon_std_ta'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_afternoon_std_ta:0
inputs['afternoon_sumta'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_afternoon_sumta:0
inputs['afternoon_tc'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_afternoon_tc:0
inputs['ai_daypart'] tensor_info:
dtype: DT_INT32
shape: (-1, 7)
name: serving_default_ai_daypart:0
inputs['ai_id'] tensor_info:
dtype: DT_INT32
shape: (-1, 1)
name: serving_default_ai_id:0
inputs['ai_isLTO'] tensor_info:
dtype: DT_INT32
shape: (-1, 1)
name: serving_default_ai_isLTO:0
inputs['ai_isPreserve'] tensor_info:
dtype: DT_INT32
shape: (-1, 1)
name: serving_default_ai_isPreserve:0
inputs['ai_itemId'] tensor_info:
dtype: DT_INT32
shape: (-1, 1)
name: serving_default_ai_itemId:0
inputs['ai_itemType'] tensor_info:
dtype: DT_INT32
shape: (-1, 1)
name: serving_default_ai_itemType:0
inputs['ai_occasion'] tensor_info:
dtype: DT_INT32
shape: (-1, 3)
name: serving_default_ai_occasion:0
inputs['appVersion'] tensor_info:
dtype: DT_INT32
shape: (-1, 1)
name: serving_default_appVersion:0
inputs['avg_city_tier'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_avg_city_tier:0
inputs['avg_delivery_party_size'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_avg_delivery_party_size:0
inputs['avg_discount'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_avg_discount:0
inputs['avg_party_size'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_avg_party_size:0
inputs['avg_preorder_party_size'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_avg_preorder_party_size:0
inputs['avg_ta_by_ps'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_avg_ta_by_ps:0
inputs['biz_date'] tensor_info:
dtype: DT_INT32
shape: (-1, 1)
name: serving_default_biz_date:0
inputs['burger_sell_price'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_burger_sell_price:0
inputs['burger_sold'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_burger_sold:0
inputs['chicken_burger_soldratio_crusty'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_chicken_burger_soldratio_crusty:0
inputs['chicken_burger_soldratio_orlean'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_chicken_burger_soldratio_orlean:0
inputs['chicken_burger_soldratio_spicy'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_chicken_burger_soldratio_spicy:0
inputs['chickensnack_sell_price'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_chickensnack_sell_price:0
inputs['chickensnack_sold'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_chickensnack_sold:0
inputs['cityName'] tensor_info:
dtype: DT_INT32
shape: (-1, 1)
name: serving_default_cityName:0
inputs['city_name_set_30day'] tensor_info:
dtype: DT_INT32
shape: (-1, 30)
name: serving_default_city_name_set_30day:0
inputs['city_name_set_repeat25tc'] tensor_info:
dtype: DT_INT32
shape: (-1, 4)
name: serving_default_city_name_set_repeat25tc:0
inputs['city_tier_set_30day'] tensor_info:
dtype: DT_INT32
shape: (-1, 7)
name: serving_default_city_tier_set_30day:0
inputs['city_tier_set_repeat25tc'] tensor_info:
dtype: DT_INT32
shape: (-1, 4)
name: serving_default_city_tier_set_repeat25tc:0
inputs['cob_sell_price'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_cob_sell_price:0
inputs['cob_sold'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_cob_sold:0
inputs['coffee_sell_price'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_coffee_sell_price:0
inputs['coffee_sold'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_coffee_sold:0
inputs['congee_sell_price'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_congee_sell_price:0
inputs['congee_sold'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_congee_sold:0
inputs['content_title'] tensor_info:
dtype: DT_INT32
shape: (-1, 1)
name: serving_default_content_title:0
inputs['content_type'] tensor_info:
dtype: DT_INT32
shape: (-1, 1)
name: serving_default_content_type:0
inputs['croissant_sell_price'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_croissant_sell_price:0
inputs['croissant_sold'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_croissant_sold:0
inputs['csd_sell_price'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_csd_sell_price:0
inputs['csd_sold'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_csd_sold:0
inputs['dabing_sell_price'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_dabing_sell_price:0
inputs['dabing_sold'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_dabing_sold:0
inputs['day_of_week_set_30day'] tensor_info:
dtype: DT_INT32
shape: (-1, 7)
name: serving_default_day_of_week_set_30day:0
inputs['day_of_week_set_repeat25tc'] tensor_info:
dtype: DT_INT32
shape: (-1, 4)
name: serving_default_day_of_week_set_repeat25tc:0
inputs['daypart_name_set_30day'] tensor_info:
dtype: DT_INT32
shape: (-1, 7)
name: serving_default_daypart_name_set_30day:0
inputs['daypart_name_set_repeat25tc'] tensor_info:
dtype: DT_INT32
shape: (-1, 4)
name: serving_default_daypart_name_set_repeat25tc:0
inputs['delivery_ta'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_delivery_ta:0
inputs['delivery_tc'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_delivery_tc:0
inputs['deviceType'] tensor_info:
dtype: DT_INT32
shape: (-1, 1)
name: serving_default_deviceType:0
inputs['dinner_avgta'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_dinner_avgta:0
inputs['dinner_maxta'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_dinner_maxta:0
inputs['dinner_minta'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_dinner_minta:0
inputs['dinner_std_ta'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_dinner_std_ta:0
inputs['dinner_sumta'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_dinner_sumta:0
inputs['dinner_tc'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_dinner_tc:0
inputs['distinct_city'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_distinct_city:0
inputs['distinct_daypart'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_distinct_daypart:0
inputs['distinct_store'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_distinct_store:0
inputs['distinct_work_day'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_distinct_work_day:0
inputs['eggtart_sell_price'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_eggtart_sell_price:0
inputs['eggtart_sold'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_eggtart_sold:0
inputs['end_time'] tensor_info:
dtype: DT_INT32
shape: (-1, 1)
name: serving_default_end_time:0
inputs['fri_avgta'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_fri_avgta:0
inputs['fri_maxta'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_fri_maxta:0
inputs['fri_minta'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_fri_minta:0
inputs['fri_std_ta'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_fri_std_ta:0
inputs['fri_sumta'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_fri_sumta:0
inputs['fri_tc'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_fri_tc:0
inputs['homePageTag'] tensor_info:
dtype: DT_INT32
shape: (-1, 1)
name: serving_default_homePageTag:0
inputs['icecream_sell_price'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_icecream_sell_price:0
inputs['icecream_sold'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_icecream_sold:0
inputs['juice_sell_price'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_juice_sell_price:0
inputs['juice_sold'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_juice_sold:0
inputs['lasttrans_b_city'] tensor_info:
dtype: DT_INT32
shape: (-1, 1)
name: serving_default_lasttrans_b_city:0
inputs['lasttrans_b_city_tier'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_lasttrans_b_city_tier:0
inputs['lasttrans_b_date'] tensor_info:
dtype: DT_INT32
shape: (-1, 1)
name: serving_default_lasttrans_b_date:0
inputs['lasttrans_b_daypart'] tensor_info:
dtype: DT_INT32
shape: (-1, 1)
name: serving_default_lasttrans_b_daypart:0
inputs['lasttrans_b_sell_code'] tensor_info:
dtype: DT_INT32
shape: (-1, 1)
name: serving_default_lasttrans_b_sell_code:0
inputs['lasttrans_b_store_code'] tensor_info:
dtype: DT_INT32
shape: (-1, 1)
name: serving_default_lasttrans_b_store_code:0
inputs['lasttrans_b_ta'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_lasttrans_b_ta:0
inputs['lasttrans_nb_city'] tensor_info:
dtype: DT_INT32
shape: (-1, 1)
name: serving_default_lasttrans_nb_city:0
inputs['lasttrans_nb_city_tier'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_lasttrans_nb_city_tier:0
inputs['lasttrans_nb_date'] tensor_info:
dtype: DT_INT32
shape: (-1, 1)
name: serving_default_lasttrans_nb_date:0
inputs['lasttrans_nb_daypart'] tensor_info:
dtype: DT_INT32
shape: (-1, 1)
name: serving_default_lasttrans_nb_daypart:0
inputs['lasttrans_nb_sell_code'] tensor_info:
dtype: DT_INT32
shape: (-1, 1)
name: serving_default_lasttrans_nb_sell_code:0
inputs['lasttrans_nb_store_code'] tensor_info:
dtype: DT_INT32
shape: (-1, 1)
name: serving_default_lasttrans_nb_store_code:0
inputs['lasttrans_nb_ta'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_lasttrans_nb_ta:0
inputs['latenight_avgta'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_latenight_avgta:0
inputs['latenight_maxta'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_latenight_maxta:0
inputs['latenight_minta'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_latenight_minta:0
inputs['latenight_std_ta'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_latenight_std_ta:0
inputs['latenight_sumta'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_latenight_sumta:0
inputs['latenight_tc'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_latenight_tc:0
inputs['lto_sell_price'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_lto_sell_price:0
inputs['lto_sold'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_lto_sold:0
inputs['lunch_avgta'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_lunch_avgta:0
inputs['lunch_maxta'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_lunch_maxta:0
inputs['lunch_minta'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_lunch_minta:0
inputs['lunch_std_ta'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_lunch_std_ta:0
inputs['lunch_sumta'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_lunch_sumta:0
inputs['main_businessObject'] tensor_info:
dtype: DT_INT32
shape: (-1, 5)
name: serving_default_main_businessObject:0
inputs['master_id'] tensor_info:
dtype: DT_INT32
shape: (-1, 1)
name: serving_default_master_id:0
inputs['max_city_tier'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_max_city_tier:0
inputs['max_delivery_party_size'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_max_delivery_party_size:0
inputs['max_discount'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_max_discount:0
inputs['max_party_size'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_max_party_size:0
inputs['max_preorder_party_size'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_max_preorder_party_size:0
inputs['min_city_tier'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_min_city_tier:0
inputs['min_delivery_party_size'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_min_delivery_party_size:0
inputs['min_discount'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_min_discount:0
inputs['min_party_size'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_min_party_size:0
inputs['min_preorder_party_size'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_min_preorder_party_size:0
inputs['mon_avgta'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_mon_avgta:0
inputs['mon_maxta'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_mon_maxta:0
inputs['mon_minta'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_mon_minta:0
inputs['mon_std_ta'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_mon_std_ta:0
inputs['mon_sumta'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_mon_sumta:0
inputs['mon_tc'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_mon_tc:0
inputs['morning_avgta'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_morning_avgta:0
inputs['morning_maxta'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_morning_maxta:0
inputs['morning_minta'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_morning_minta:0
inputs['morning_std_ta'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_morning_std_ta:0
inputs['morning_sumta'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_morning_sumta:0
inputs['morning_tc'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_morning_tc:0
inputs['nonbreakfast_avgta'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_nonbreakfast_avgta:0
inputs['nonbreakfast_maxta'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_nonbreakfast_maxta:0
inputs['nonbreakfast_minta'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_nonbreakfast_minta:0
inputs['nonbreakfast_std_ta'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_nonbreakfast_std_ta:0
inputs['nonbreakfast_sumta'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_nonbreakfast_sumta:0
inputs['nonbreakfast_tc'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_nonbreakfast_tc:0
inputs['nonfood_sell_price'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_nonfood_sell_price:0
inputs['nonfood_sold'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_nonfood_sold:0
inputs['nutrition_sell_price'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_nutrition_sell_price:0
inputs['nutrition_sold'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_nutrition_sold:0
inputs['occasion_name_set_30day'] tensor_info:
dtype: DT_INT32
shape: (-1, 7)
name: serving_default_occasion_name_set_30day:0
inputs['occasion_name_set_repeat25tc'] tensor_info:
dtype: DT_INT32
shape: (-1, 4)
name: serving_default_occasion_name_set_repeat25tc:0
inputs['osVersion'] tensor_info:
dtype: DT_INT32
shape: (-1, 1)
name: serving_default_osVersion:0
inputs['panini_sell_price'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_panini_sell_price:0
inputs['panini_sold'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_panini_sold:0
inputs['party_size_set_30day'] tensor_info:
dtype: DT_INT32
shape: (-1, 2)
name: serving_default_party_size_set_30day:0
inputs['party_size_set_repeat25tc'] tensor_info:
dtype: DT_INT32
shape: (-1, 2)
name: serving_default_party_size_set_repeat25tc:0
inputs['pie_sell_price'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_pie_sell_price:0
inputs['pie_sold'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_pie_sold:0
inputs['preorder_ta'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_preorder_ta:0
inputs['preorder_tc'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_preorder_tc:0
inputs['previousPage'] tensor_info:
dtype: DT_INT32
shape: (-1, 1)
name: serving_default_previousPage:0
inputs['product_category_name_set_30day'] tensor_info:
dtype: DT_INT32
shape: (-1, 9)
name: serving_default_product_category_name_set_30day:0
inputs['product_category_name_set_repeat25tc'] tensor_info:
dtype: DT_INT32
shape: (-1, 8)
name: serving_default_product_category_name_set_repeat25tc:0
inputs['product_class_name_set_30day'] tensor_info:
dtype: DT_INT32
shape: (-1, 30)
name: serving_default_product_class_name_set_30day:0
inputs['product_class_name_set_repeat25tc'] tensor_info:
dtype: DT_INT32
shape: (-1, 21)
name: serving_default_product_class_name_set_repeat25tc:0
inputs['product_item_name_set_30day'] tensor_info:
dtype: DT_INT32
shape: (-1, 30)
name: serving_default_product_item_name_set_30day:0
inputs['product_item_name_set_repeat25tc'] tensor_info:
dtype: DT_INT32
shape: (-1, 30)
name: serving_default_product_item_name_set_repeat25tc:0
inputs['product_sub_category_name_set_30day'] tensor_info:
dtype: DT_INT32
shape: (-1, 30)
name: serving_default_product_sub_category_name_set_30day:0
inputs['product_sub_category_name_set_repeat25tc'] tensor_info:
dtype: DT_INT32
shape: (-1, 18)
name: serving_default_product_sub_category_name_set_repeat25tc:0
inputs['product_sub_class_name_set_30day'] tensor_info:
dtype: DT_INT32
shape: (-1, 30)
name: serving_default_product_sub_class_name_set_30day:0
inputs['product_sub_class_name_set_repeat25tc'] tensor_info:
dtype: DT_INT32
shape: (-1, 29)
name: serving_default_product_sub_class_name_set_repeat25tc:0
inputs['rice_sell_price'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_rice_sell_price:0
inputs['rice_sold'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_rice_sold:0
inputs['riceroll_sell_price'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_riceroll_sell_price:0
inputs['riceroll_sold'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_riceroll_sold:0
inputs['sat_avgta'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_sat_avgta:0
inputs['sat_maxta'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_sat_maxta:0
inputs['sat_minta'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_sat_minta:0
inputs['sat_std_ta'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_sat_std_ta:0
inputs['sat_sumta'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_sat_sumta:0
inputs['sat_tc'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_sat_tc:0
inputs['screenresolution'] tensor_info:
dtype: DT_INT32
shape: (-1, 1)
name: serving_default_screenresolution:0
inputs['side_sell_price'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_side_sell_price:0
inputs['side_sold'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_side_sold:0
inputs['sidefrenchfries_sell_price'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_sidefrenchfries_sell_price:0
inputs['sidefrenchfries_sold'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_sidefrenchfries_sold:0
inputs['sideothers_sell_price'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_sideothers_sell_price:0
inputs['sideothers_sold'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_sideothers_sold:0
inputs['start_time'] tensor_info:
dtype: DT_INT32
shape: (-1, 1)
name: serving_default_start_time:0
inputs['std_city_tier'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_std_city_tier:0
inputs['std_delivery_party_size'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_std_delivery_party_size:0
inputs['std_discount'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_std_discount:0
inputs['std_party_size'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_std_party_size:0
inputs['std_preorder_party_size'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_std_preorder_party_size:0
inputs['std_ta_by_ps'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_std_ta_by_ps:0
inputs['storeCode'] tensor_info:
dtype: DT_INT32
shape: (-1, 1)
name: serving_default_storeCode:0
inputs['store_code_set_30day'] tensor_info:
dtype: DT_INT32
shape: (-1, 30)
name: serving_default_store_code_set_30day:0
inputs['store_code_set_repeat25tc'] tensor_info:
dtype: DT_INT32
shape: (-1, 4)
name: serving_default_store_code_set_repeat25tc:0
inputs['sum_discount'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_sum_discount:0
inputs['sun_avgta'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_sun_avgta:0
inputs['sun_maxta'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_sun_maxta:0
inputs['sun_minta'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_sun_minta:0
inputs['sun_std_ta'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_sun_std_ta:0
inputs['sun_sumta'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_sun_sumta:0
inputs['sun_tc'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_sun_tc:0
inputs['ta'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_ta:0
inputs['tc'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_tc:0
inputs['tea_sell_price'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_tea_sell_price:0
inputs['tea_sold'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_tea_sold:0
inputs['thu_avgta'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_thu_avgta:0
inputs['thu_maxta'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_thu_maxta:0
inputs['thu_minta'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_thu_minta:0
inputs['thu_std_ta'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_thu_std_ta:0
inputs['thu_sumta'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_thu_sumta:0
inputs['thu_tc'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_thu_tc:0
inputs['tier1_tc'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_tier1_tc:0
inputs['tier2_tc'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_tier2_tc:0
inputs['tier3_tc'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_tier3_tc:0
inputs['tier4_tc'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_tier4_tc:0
inputs['tier5_tc'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_tier5_tc:0
inputs['tier6_tc'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_tier6_tc:0
inputs['tue_avgta'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_tue_avgta:0
inputs['tue_maxta'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_tue_maxta:0
inputs['tue_minta'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_tue_minta:0
inputs['tue_std_ta'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_tue_std_ta:0
inputs['tue_sumta'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_tue_sumta:0
inputs['tue_tc'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_tue_tc:0
inputs['twister_sell_price'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_twister_sell_price:0
inputs['twister_sold'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_twister_sold:0
inputs['userAgent'] tensor_info:
dtype: DT_INT32
shape: (-1, 1)
name: serving_default_userAgent:0
inputs['waffle_sell_price'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_waffle_sell_price:0
inputs['waffle_sold'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_waffle_sold:0
inputs['wen_avgta'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_wen_avgta:0
inputs['wen_maxta'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_wen_maxta:0
inputs['wen_minta'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_wen_minta:0
inputs['wen_std_ta'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_wen_std_ta:0
inputs['wen_sumta'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_wen_sumta:0
inputs['wen_tc'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_wen_tc:0
inputs['wing_sell_price'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_wing_sell_price:0
inputs['wing_sold'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: serving_default_wing_sold:0
The given SavedModel SignatureDef contains the following output(s):
outputs['prediction_layer_10'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 1)
name: StatefulPartitionedCall:0
Method name is: tensorflow/serving/predict

拼出curl

1
2
3
4
5
6
7
curl -X POST -i 'http://127.0.0.1:8501/v1/models/heart_model:predict' --data '
{
"signature_name": "serving_default",
"instances": [
{"dinner_sumta": [0], "biz_date": [1], "userAgent": [126], "dabing_sell_price": [0], "morning_std_ta": [0], "wen_avgta": [0], "store_code_set_repeat25tc": [70, 0, 0, 0], "std_city_tier": [0], "csd_sold": [0], "thu_sumta": [0], "distinct_city": [0], "occasion_name_set_repeat25tc": [3, 0, 0, 0], "wen_maxta": [0], "morning_minta": [0], "appVersion": [2], "tier4_tc": [0], "delivery_tc": [0], "start_time": [0], "lasttrans_nb_city": [866], "ad_id": [36], "std_party_size": [0], "afternoon_tc": [0], "daypart_name_set_repeat25tc": [4, 0, 0, 0], "max_party_size": [0], "lasttrans_b_city_tier": [0], "wen_sumta": [0], "sun_minta": [0], "distinct_store": [0], "tue_std_ta": [0], "product_category_name_set_repeat25tc": [7, 0, 0, 0, 0, 0, 0, 0], "sideothers_sell_price": [0], "thu_minta": [0], "wen_std_ta": [0], "city_tier_set_repeat25tc": [4, 0, 0, 0], "preorder_ta": [0], "fri_sumta": [0], "twister_sold": [0], "master_id": [27], "end_time": [0], "thu_avgta": [0], "product_class_name_set_repeat25tc": [28, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], "panini_sell_price": [0], "nonbreakfast_std_ta": [0], "avg_party_size": [0], "chickensnack_sell_price": [0], "lunch_std_ta": [0], "sidefrenchfries_sell_price": [0], "product_sub_class_name_set_repeat25tc": [25, 52, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], "nonbreakfast_maxta": [0], "ad_designStyle": [1], "afternoon_std_ta": [0], "riceroll_sold": [0], "ai_isLTO": [1], "morning_avgta": [0], "latenight_minta": [0], "lasttrans_nb_ta": [0], "day_of_week_set_repeat25tc": [4, 0, 0, 0], "fri_tc": [0], "tue_tc": [0], "sat_std_ta": [0], "sat_tc": [0], "latenight_maxta": [0], "sat_avgta": [0], "chickensnack_sold": [0], "rice_sold": [0], "mon_tc": [0], "sideothers_sold": [0], "morning_maxta": [0], "lasttrans_nb_date": [180], "lunch_maxta": [0], "day_of_week_set_30day": [4, 0, 0, 0, 0, 0, 0], "sidefrenchfries_sold": [0], "lasttrans_nb_store_code": [7970], "chicken_burger_soldratio_spicy": [0], "nutrition_sold": [0], "avg_delivery_party_size": [0], "sum_discount": [0], "mon_minta": [0], "std_ta_by_ps": [0], "avg_city_tier": [0], "sun_maxta": [0], "tue_sumta": [0], "min_discount": [0], "product_sub_class_name_set_30day": [12, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], "wen_minta": [0], "mon_avgta": [0], "tier1_tc": [0], "tier2_tc": [0], "storeCode": [7301], "party_size_set_repeat25tc": [2, 0], "mon_maxta": [0], "tea_sold": [0], "riceroll_sell_price": [0], "nonfood_sell_price": [0], "burger_sell_price": [0], "tier5_tc": [0], "min_party_size": [0], "juice_sold": [0], "preorder_tc": [0], "ai_id": [27], "lasttrans_nb_city_tier": [0], "ai_itemId": [18], "max_preorder_party_size": [0], "previousPage": [1], "wen_tc": [0], "lunch_minta": [0], "waffle_sell_price": [0], "avg_discount": [0], "max_discount": [0], "product_item_name_set_repeat25tc": [26, 77, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], "lunch_sumta": [0], "burger_sold": [0], "homePageTag": [0], "fri_avgta": [0], "dabing_sold": [0], "fri_minta": [0], "afternoon_avgta": [0], "nonbreakfast_avgta": [0], "lto_sell_price": [0], "nonbreakfast_sumta": [0], "croissant_sell_price": [0], "sun_tc": [0], "thu_maxta": [0], "osVersion": [0], "rice_sell_price": [0], "cob_sold": [0], "sun_sumta": [0], "csd_sell_price": [0], "lasttrans_b_date": [1], "lasttrans_b_store_code": [1], "main_businessObject": [1, 3, 4, 0, 0], "min_preorder_party_size": [0], "wing_sell_price": [0], "tier3_tc": [0], "sat_minta": [0], "side_sell_price": [0], "latenight_std_ta": [0], "min_delivery_party_size": [0], "lasttrans_b_sell_code": [1], "thu_std_ta": [0], "waffle_sold": [0], "std_delivery_party_size": [0], "side_sold": [0], "sat_sumta": [0], "sat_maxta": [0], "coffee_sold": [0], "lasttrans_b_daypart": [1], "tier6_tc": [0], "product_category_name_set_30day": [6, 0, 0, 0, 0, 0, 0, 0, 0], "panini_sold": [0], "screenresolution": [502], "occasion_name_set_30day": [3, 0, 0, 0, 0, 0, 0], "city_name_set_30day": [42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], "lto_sold": [0], "lasttrans_b_city": [1], "std_discount": [0], "icecream_sell_price": [0], "congee_sell_price": [0], "mon_sumta": [0], "ai_occasion": [1, 2, 0], "eggtart_sold": [0], "dinner_maxta": [0], "afternoon_maxta": [0], "pie_sell_price": [0], "product_class_name_set_30day": [33, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], "product_item_name_set_30day": [13, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], "dinner_tc": [0], "sun_avgta": [0], "distinct_work_day": [0], "content_title": [44], "min_city_tier": [0], "ad_creativeType": [1, 0, 0], "lunch_avgta": [0], "nonbreakfast_tc": [0], "tue_maxta": [0], "store_code_set_30day": [65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], "congee_sold": [0], "tue_avgta": [0], "city_name_set_repeat25tc": [55, 0, 0, 0], "daypart_name_set_30day": [5, 0, 0, 0, 0, 0, 0], "lasttrans_nb_daypart": [3], "cityName": [195], "dinner_avgta": [0], "icecream_sold": [0], "eggtart_sell_price": [0], "lasttrans_nb_sell_code": [2351], "morning_sumta": [0], "fri_std_ta": [0], "lasttrans_b_ta": [0], "distinct_daypart": [0], "morning_tc": [0], "ai_itemType": [1], "avg_preorder_party_size": [0], "sun_std_ta": [0], "product_sub_category_name_set_repeat25tc": [3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], "pie_sold": [0], "party_size_set_30day": [2, 0], "croissant_sold": [0], "ad_mainColor": [5], "latenight_tc": [0], "nutrition_sell_price": [0], "juice_sell_price": [0], "mon_std_ta": [0], "deviceType": [0], "dinner_std_ta": [0], "thu_tc": [0], "twister_sell_price": [0], "latenight_sumta": [0], "tue_minta": [0], "delivery_ta": [0], "fri_maxta": [0], "afternoon_sumta": [0], "nonfood_sold": [0], "tea_sell_price": [0], "max_delivery_party_size": [0], "coffee_sell_price": [0], "wing_sold": [0], "afternoon_minta": [0], "nonbreakfast_minta": [0], "content_type": [2], "chicken_burger_soldratio_orlean": [0], "chicken_burger_soldratio_crusty": [0], "max_city_tier": [0], "cob_sell_price": [0], "std_preorder_party_size": [0], "latenight_avgta": [0], "avg_ta_by_ps": [0], "ai_isPreserve": [1], "tc": [0], "city_tier_set_30day": [6, 0, 0, 0, 0, 0, 0], "ai_daypart": [1, 2, 3, 4, 5, 0, 0], "dinner_minta": [0], "ta": [0], "product_sub_category_name_set_30day": [8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]}
]
}'

转载请注明来源,欢迎对文章中的引用来源进行考证,欢迎指出任何有错误或不够清晰的表达。可以在下面评论区评论,也可以邮件至 zoubinbf@163.com

×

喜欢就点赞,疼爱就打赏