warming up... Batch size batch time mean 1 1.827ms 1.827ms 5 2.183ms 0.437ms 10 2.285ms 0.228ms 20 2.601ms 0.130ms 30 2.874ms 0.096ms 40 3.247ms 0.081ms 50 3.674ms 0.073ms 70 4.268ms 0.061ms 100 5.272ms 0.053ms 120 6.181ms 0.052ms 150 6.794ms 0.045ms 170 7.837ms 0.046ms 200 8.320ms 0.042ms
warming up... Batch size batch time mean 1 21.548ms 21.548ms 5 23.487ms 4.697ms 10 19.810ms 1.981ms 20 19.354ms 0.968ms 30 22.020ms 0.734ms 40 22.368ms 0.559ms 50 24.338ms 0.487ms 70 22.637ms 0.323ms 100 19.137ms 0.191ms 120 21.951ms 0.183ms 150 22.061ms 0.147ms 170 23.557ms 0.139ms 200 18.811ms 0.094ms
--
To unsubscribe from this group and stop receiving emails from it, send an email to testing+u...@tensorflow.org.
classes = session.graph.get_tensor_by_name('predictions/str_classes:0'),def time_saved_model(saved_model_dir):tf.reset_default_graph()config = tf.ConfigProto(intra_op_parallelism_threads = 1, inter_op_parallelism_threads = 1, device_count={'CPU': 1})with tf.Session(graph=tf.Graph(), config=config) as session:tf.saved_model.loader.load(session, [tf.saved_model.tag_constants.SERVING], saved_model_dir)examples = session.graph.get_tensor_by_name('input_tensors:0'),
print("warming up...")for i in range(1000):
session.run([classes, scores],feed_dict = {examples: np.array(records[0:10])},# options=run_options,# run_metadata=run_metadata)print("Batch size\tbatch time\tmean")
for batchsize in (1,5,10,20,30,40,50,70,100, 120, 150, 170, 200):data = recordstimes = []t_total = 0.0for i in range(1000):
batch = np.array(data[0:batchsize])
data = data[batchsize:]t0 = time.time()
session.run([classes, scores],feed_dict = {examples: batch}
)t1 = time.time()times.append((t1 - t0) * 1000)t_total += (t1-t0)print('%3d\t\t%3.3fms\t\t%3.3fms' % (batchsize, t_total, t_total/batchsize))
model = tf.saved_model.load(...)
signature = model.signatures["serving_default"]
To unsubscribe from this group and stop receiving emails from it, send an email to tes...@tensorflow.org.
To unsubscribe from this group and stop receiving emails from it, send an email to testing+u...@tensorflow.org.
To unsubscribe from this group and stop receiving emails from it, send an email to tes...@tensorflow.org.
Is this measured on CPU? How do you execute the SavedModel? Using Servo? Loading into Python? Could you share the code you have used?</
--
To unsubscribe from this group and stop receiving emails from it, send an email to testing+u...@tensorflow.org.
To unsubscribe from this group and stop receiving emails from it, send an email to tes...@tensorflow.org.
To unsubscribe from this group and stop receiving emails from it, send an email to testing+u...@tensorflow.org.