Commit 67a36e5b authored by Your Name's avatar Your Name

bug fix

parent ec1eb585
...@@ -141,10 +141,10 @@ def input_fn(filenames, batch_size=32, num_epochs=1, perform_shuffle=False): ...@@ -141,10 +141,10 @@ def input_fn(filenames, batch_size=32, num_epochs=1, perform_shuffle=False):
#print(batch_features,batch_labels) #print(batch_features,batch_labels)
return batch_features, batch_labels return batch_features, batch_labels
def main(): def main(te_file):
# dt_dir = (date.today() + timedelta(-1)).strftime('%Y%m%d') # dt_dir = (date.today() + timedelta(-1)).strftime('%Y%m%d')
model_dir = "hdfs://172.16.32.4:8020/strategy/esmm/model_ckpt/DeepCvrMTL/" model_dir = "hdfs://172.16.32.4:8020/strategy/esmm/model_ckpt/DeepCvrMTL/"
te_files = ["hdfs://172.16.32.4:8020/strategy/esmm/nearby/part-r-00000"] # te_files = ["hdfs://172.16.32.4:8020/strategy/esmm/nearby/part-r-00000"]
model_params = { model_params = {
"field_size": 15, "field_size": 15,
"feature_size": 600000, "feature_size": 600000,
...@@ -159,7 +159,7 @@ def main(): ...@@ -159,7 +159,7 @@ def main():
log_step_count_steps=100, save_summary_steps=100) log_step_count_steps=100, save_summary_steps=100)
Estimator = tf.estimator.Estimator(model_fn=model_fn, model_dir=model_dir, params=model_params, config=config) Estimator = tf.estimator.Estimator(model_fn=model_fn, model_dir=model_dir, params=model_params, config=config)
preds = Estimator.predict(input_fn=lambda: input_fn(te_files, num_epochs=1, batch_size=10000), predict_keys=["pctcvr","pctr","pcvr"]) preds = Estimator.predict(input_fn=lambda: input_fn(te_file, num_epochs=1, batch_size=10000), predict_keys=["pctcvr","pctr","pcvr"])
# indices = [] # indices = []
# for prob in preds: # for prob in preds:
# indices.append([prob['pctr'], prob['pcvr'], prob['pctcvr']]) # indices.append([prob['pctr'], prob['pcvr'], prob['pctcvr']])
...@@ -191,14 +191,12 @@ if __name__ == "__main__": ...@@ -191,14 +191,12 @@ if __name__ == "__main__":
test = name.repartition(5).map(lambda x: test_map(x)) test = name.repartition(5).map(lambda x: test_map(x))
print(test) print(test)
test.collect() print(test.collect())
tf.logging.set_verbosity(tf.logging.INFO)
te_files = ["hdfs://172.16.32.4:8020/strategy/esmm/nearby/part-r-00000"] te_files = ["hdfs://172.16.32.4:8020/strategy/esmm/nearby/part-r-00000"]
main(te_files)
b = time.time() b = time.time()
tf.logging.set_verbosity(tf.logging.INFO)
# tf.app.run()
# main()
print("耗时(分钟):") print("耗时(分钟):")
print((time.time()-b)/60) print((time.time()-b)/60)
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