Closed King4819 closed 2 months ago
Hi, it can be easier to test the latency rather than FLOPs.
For FLOPs, see issue 5.
I would like to ask another question about FLOPs calculation. Since the method will automatically allocate different number of tokens for different images, the FLOPs will therefore be different with different input images (larger FLOPs for complicated image and smaller FLOPs for simple image). One reasonable way to calculate the FLOPs result of pruned model is by calculating the FLOPs given each image in ImageNet val set then average them ?
I would like to ask another question about FLOPs calculation. Since the method will automatically allocate different number of tokens for different images, the FLOPs will therefore be different with different input images (larger FLOPs for complicated image and smaller FLOPs for simple image). One reasonable way to calculate the FLOPs result of pruned model is by calculating the FLOPs given each image in ImageNet val set then average them ?
Yes, I think so! Or you could approximate it by finding the average number of tokens used on ImageNet val and use one image which activated this number of tokens.
Thanks for your reply
Hi, I want to ask that is there any method that can calculates FLOPs based on your code ?
I want to calculate the FLOPs of SViT-T when inferencing different images (since the method will give different prune ratio according to different images).
I have tried fvcore but it doesn't work. I have also tried mmcv tools to calculate FLOPs but the function can only take input image shape instead of image (so that I can't calculate FLOPs after token-pruning)
THANKS !!!