-
Notifications
You must be signed in to change notification settings - Fork 593
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
Getting very less FPS #97
Comments
Hey, you haven't listed your fps or device and confirmation the framework is using your devices specialized processing unit. Besides that, the resize operation can significantly affecting timing. The example image they used is 768 × 576. Two factors that I know will add time to the resize operation (which your code calls twice; don't know if the second call will be used), are size of the image and complexity of the image. You should confirm your fps using the example from the link. |
@3dsf 2-Even then I think the FPS is very low. I'm getting less than 2 FPS 3- You mentioned that they used 768 × 576 as the example image. The input image shape I'm using is (480, 640, 3), converting it to (256,256,3) and then feeding the input to the model Here's the new script that I'm using, still getting less than 2 FPS
And as you said, I also used the code example from the link, still getting the same results. |
You are definitely is not using the GPU. |
@3dsf
I get 1 as output. My tensorflow-gpu is properly set up. But for some weird reason, the GPU is not being used in case of a '.tflite' model |
Can you verify the time you get by running this code and verifying the Inference block ? I get ~0.53 seconds for the inference block (2060s; 3.1ghz processor); About 22 seconds for the whole thing. As a note, when running models in other frameswork, usually the first inference took significantly longer. Also .53 feel slow for this when comparing against the pytorch model, I'll test the image later. |
It took 0.5265460014343262 seconds to run the inference block and 74.80340027809143 seconds to run the entire script due to my slow internet. This is quite slow. And about running the model first time, I ran mine for a couple of times but got the same results |
Sorry, I should rephrase, with pytorch and some other frameworks, the first inference always takes longer. ex//
ex//
For reference, same image, different name Now when I try it with tflite
I see improved timings, but they are still poor. Note I've been sloppy in implementing the timing around the inference blocks in this example and have excluded some pre/post processing, but I would still stand by this example to factor performance between different models. Maybe consider switching frameworks if possible, or consult the tflite community for further guidance for a potentially faster implementation. |
The same model runs on android and iOS with over 20 FPS, I don't understand why it's running so poorly on my PC |
It probably is because of how tflite was compiled. That is part of the reason I asked about how it was installed. On the stout, there were info lines suggesting there could be optimizations. I installed in a conda virtual environment using pip. I would imagine the results will be better if compiled from SRC with attention to the build flags relevant to the hardware. Tflite was probably designed with mobile processors in mind. Additionally in the example of the apple processing chip, the data is probably not switched between devices (cpu--gpu--cpu) which can performance implications. I can't comment on Android, that could be anything. |
also maybe something like this will be able to help you |
I'm using this tflite model and running it on my PC using this script
But I'm getting a very low frame rate. I'm sure I'm doing something wrong, Can anyone help me out here?
The text was updated successfully, but these errors were encountered: