Commit 16a3779c authored by 赵威's avatar 赵威

try predict

parent cb4429a4
import datetime
import time
import tensorflow as tf
from models.esmm.fe import (get_device_dict_from_redis, get_diary_dict_from_redis)
from models.esmm.model import model_predict_diary
......@@ -29,12 +32,24 @@ def user_portrait_scan_info():
print(e)
if __name__ == "__main__":
def main():
time_begin = time.time()
tf.logging.set_verbosity(tf.compat.v1.logging.INFO)
device_dict = get_device_dict_from_redis()
diary_dict = get_diary_dict_from_redis()
device_id = "androidid_a25a1129c0b38f7b"
model_path = "/home/gmuser/data/models/1595501144"
save_path = "/home/gmuser/data/models/1595501144"
predict_fn = tf.contrib.predictor.from_saved_model(save_path)
diary_ids = user_portrait_tag3_get_candidate_unread_list(device_id, "diary")
model_predict_diary(device_id, diary_ids)
model_predict_diary(device_id, diary_ids, device_dict, diary_dict, predict_fn)
# user_portrait_scan_info()
total_time = (time.time() - time_begin) / 60
print("total cost {:.2f} mins at {}".format(total_time, datetime.now()))
if __name__ == "__main__":
main()
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