Commit fa0c9d66 authored by 赵威's avatar 赵威

try load data

parent 3cdb4896
import timeit
import numba
import json
import tensorflow as tf
from tensorflow import feature_column as fc
from tensorflow.python.estimator.canned import head as head_lib
......@@ -124,11 +124,16 @@ def model_predict_diary(device_id, diary_ids, device_dict, diary_dict, predict_f
example = tf.train.Example(features=tf.train.Features(feature=features))
examples.append(example.SerializeToString())
print(examples)
a = json.dumps(examples)
print(a)
b = json.loads(examples)
total_1 = (timeit.default_timer() - time_1)
print("make example cost {:.5f}s".format(total_1))
time_1 = timeit.default_timer()
predictions = predict_fn({"examples": examples})
# predictions = predict_fn({"examples": examples})
predictions = predict_fn({"examples": b})
diary_ids = []
for i in diary_lst:
diary_ids.append(i.get("card_id", "-1"))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment