Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inference time is too high(about 3.5x as supposed to be ~0.04s) #118

Open
cobbwho opened this issue Oct 31, 2019 · 0 comments
Open

Inference time is too high(about 3.5x as supposed to be ~0.04s) #118

cobbwho opened this issue Oct 31, 2019 · 0 comments

Comments

@cobbwho
Copy link

cobbwho commented Oct 31, 2019

Thank you very much for your excellent contribution.

I downloaded the code in October 2019.
system:windows1803
Graphics card:1080Ti
tensorflow-gpu :1.4.0 (I'm using cuda8.0, but 1.4.0 released in November 2017. I think it's ok)
tensorflow-tensorboard :0.4.0
model:icnet_cityscapes_trainval_90k.npy(frome google driver)

I just open demo.ipynb by using jupyter and change nothing. It ran successfully and got the right results. But when I use the code as below:

for i in range(50):
    start_t = time.time()
    
    _ = net.predict(im1)
    
    duration = time.time() - start_t
    
    if i > 0:
        elapsed_times.append(duration)

I got "Average time: 0.1461, about 6.843729 fps". It seems like that the inference time is too high(should be ~0.04s).

First, I thought the function "time.time()" maybe different between win and linux. I ruled out this later.
Then, I find some issue mentioned that maybe the first image inference time is right and the others are not. So I add print duration below duration = time.time() - start_t. Disappointingly, first picture is about 1.24 s and the others are around 0.14 s.

But I find something that seem to effect. The information print in the cmd shows that:
Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX AVX2
They all say that it is because the tensorflow version is too low. But I think it may not matter with speed. At least tensorflow-gpu 1.4.0 is appropriate in terms of time.

If there is an omission, the message is not posted. Please understand.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant