Open demuxin opened 1 month ago
Ref https://github.com/NVIDIA/TensorRT/issues/517#issuecomment-2433999764
BTW, FLOPS should not change going from TF/Torch to TRT (assuming network does not have redundant branches which don’t contribute to the network outputs). Note, if TRT actively uses horizontal and vertical fusion of different layers, so final model would be computational cheaper, than model which you initialized.
if TRT actively uses horizontal and vertical fusion of different layers, so final model would be computational cheaper, than model which you initialized.
Doesn't that statement imply that the FLOPS of the model was changed? I just want to know the final FLOPS.
You can dump the EngineInspector output by trtexec --profilingVerbosity=detailed
, it shows the weight/bias size for each layer, so you can sum them up by script.
Hi @lix19937 , Can you provide specific commands? I'm not very good at trtexec, thanks a lot.
Use trtexec --onnx=spec --dumpLayerInfo --profilingVerbosity=detailed --exportLayerInfo=layerinfo.json
This is the output file. There are no weight/bias size in the file.
like follow
"Weights": {"Type": "Float", "Count": 18432},
"Bias": {"Type": "Float", "Count": 64},
Thank you for your useful help! the method can calculate the number of params.
But calculating FLOPs feels too complicated, different layers are calculated differently, is there any easy way?
Description
I want to measure the performance of the model, so I want to know the number of parameters and FLOPs.
Is there any tool that can calculate the flops and params of the TensorRT engine?