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

how do you calculate the inference time #5

Closed
sjf18 opened this issue Jul 15, 2020 · 5 comments
Closed

how do you calculate the inference time #5

sjf18 opened this issue Jul 15, 2020 · 5 comments
Labels
bug Something isn't working

Comments

@sjf18
Copy link

sjf18 commented Jul 15, 2020

Hi, thanks for your great work, I'm curious how do you calculate your inference time, when I'm running a single image on a Tesla V100 using your minet demo, it's far from reaching 86fps.
And I also calculate your minet-res50's FLOPs and params, 162.38G and 87.06M, they are so big, how can it run so fast in your paper?

@lartpang
Copy link
Owner

As we mentioned in the paper, this time is forward reasoning time.
It is obtained by reading a single picture in turn on a dataset (ECSSD), counting all the forward reasoning time (contains only output_tensor=model (input_tensor) ), and then averaging it.

And, my device is 1080 Ti, and the input is a 320*320 RGB image.

@lartpang
Copy link
Owner

@sjf18 Thank you for your attention.
I provided the code I used to test FPS. Welcome to point out the problem.
https://github.com/lartpang/MINet/blob/master/code/utils/cal_fps.py

As for the problem that you said that the number of MINet_Res50 parameters is large, I suggest you try the version compressing the channel (https://github.com/lartpang/MINet/blob/master/code/module/MyLightModule.py), which seems to have little impact on performance. And you can use a larger batchsize to improve the performance.

@sjf18
Copy link
Author

sjf18 commented Jul 16, 2020

@lartpang
it's my misundertands, thank you!

@sjf18
Copy link
Author

sjf18 commented Jul 16, 2020

@sjf18 Thank you for your attention.
I provided the code I used to test FPS. Welcome to point out the problem.
https://github.com/lartpang/MINet/blob/master/code/utils/cal_fps.py

As for the problem that you said that the number of MINet_Res50 parameters is large, I suggest you try the version compressing the channel (https://github.com/lartpang/MINet/blob/master/code/module/MyLightModule.py), which seems to have little impact on performance. And you can use a larger batchsize to improve the performance.

i have read your codes, when you are using pytorch, if you want to test your time in cuda, you need a
torch.cuda.synchronize()

@lartpang
Copy link
Owner

lartpang commented Jul 16, 2020

@sjf18 I have fixed the code for testing FPS in current commit.

Thank you for pointing out the mistake and it will be corrected in the later version of the paper.
The current speed of MINet_VGG16 is ~35 FPS.

@lartpang lartpang pinned this issue Jul 16, 2020
@lartpang lartpang added the bug Something isn't working label Oct 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants