Commit 3268d3e7 authored by 赵威's avatar 赵威

update timer

parent 2f918780
tensorflow-gpu==1.15.2 tensorflow-gpu==1.15.2
keras==2.3.1 keras==2.3.1
pandas==1.0.5
scikit-learn==0.23.1 scikit-learn==0.23.1
redis==2.10.5 redis==2.10.5
import os import os
import shutil
import time import time
import timeit
from datetime import datetime from datetime import datetime
from pathlib import Path from pathlib import Path
import shutil
import tensorflow as tf import tensorflow as tf
from sklearn.model_selection import train_test_split from sklearn.model_selection import train_test_split
...@@ -46,10 +47,10 @@ def main(): ...@@ -46,10 +47,10 @@ def main():
# print(next(iter(predictions))) # print(next(iter(predictions)))
test_300 = test_df.sample(300) test_300 = test_df.sample(300)
time_1 = time.time() time_1 = timeit.default_timer()
model_predict(test_300, save_path) model_predict(test_300, save_path)
total_1 = (time.time() - time_1) total_1 = (timeit.default_timer() - time_1)
print("prediction cost {:.5f} s at {}".format(total_1, datetime.now())) print("prediction cost {:.5f} s".format(total_1))
total_time = (time.time() - time_begin) / 60 total_time = (time.time() - time_begin) / 60
print("cost {:.2f} mins at {}".format(total_time, datetime.now())) print("cost {:.2f} mins at {}".format(total_time, datetime.now()))
......
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