Tensorflow-Examples icon indicating copy to clipboard operation
Tensorflow-Examples copied to clipboard

7 times slower than C++ code

Open Shuhei-Kishi opened this issue 9 years ago • 2 comments

Thanks for nice code to apply to python!
I think python code is much more readable than C++ is.
By the way, in my situation, the speed of python predict code is more or less 7 times slower than C++ is. And I tried to refine by comparing the python code and C++ code. But being in the deadlock.
Do you have any idea for this? It is like, is there any factor to make this slower or any factor to make C++ predict code fast?

Shuhei-Kishi avatar Oct 14 '16 09:10 Shuhei-Kishi

Hi, are you doing the benchmark on single image or multiple images?

unography avatar Oct 14 '16 09:10 unography

I'm doing on single. But tried on some datas. I think that in C++ code, there is resize phase of input data and that makes the time better.

with python code real 0m3.314s user 0m3.673s sys 0m0.508s

with C++ code real 0m0.553466s user 0m1.14728s sys 0m0.295055s

The both was done in the same situation. ubuntu and cpu only

Shuhei-Kishi avatar Oct 14 '16 09:10 Shuhei-Kishi