0

I used the retrain code to train the final layer of the Inception model on my own images. But on my CPU machine, it is taking almost 0.5-0.8 second to extract the pool3 features.

pool3 = sess.graph.get_tensor_by_name('pool_3:0')
pf = sess.run(pool3, {png_data: imgBuffer.getvalue()})

The above lines of code take all the time. Is it because of my CPU memory? Any way to make it faster?

n00b
  • 1,549
  • 2
  • 14
  • 33

1 Answers1

0

Tensorflow uses lazy evaluation; basically all nodes in graph are evaluated on a need basis at sess.run().

This is why you noticed most of time is spent by sess.run and it is not that pool3 in particular is more expensive

You can use Timeline to find detailed time breakdown.

Community
  • 1
  • 1
Yao Zhang
  • 5,591
  • 1
  • 16
  • 22