PingoLH / FCHarDNet

Fully Convolutional HarDNet for Segmentation in Pytorch
MIT License
195 stars 52 forks source link

codes for gflops / gmacs and cio #22

Open yswang1717 opened 4 years ago

yswang1717 commented 4 years ago

Hi, -Could you please share the codes for getting gflops / gmacs and CIO? or what kind of function have you used for calculating macs? (torch == 0.4.1) -To achieve 35fps on cityscapes dataset, where did you put on start&end point? the time measurement what you calculated in validate.py performs 65 fps on cityscapes with 1024x2048. It's quite reasonable because the GPU time depends on the machine, but if you have, could you please share or mention this code or point as well?

Thank you !

PingoLH commented 4 years ago

Hi, Please refer to https://github.com/sovrasov/flops-counter.pytorch for flops counting. For CIO, you can simply add a global counter in the forward pass of ConvLayer module for both input and output tensors. For the frame rate, please note that 35fps was tested on TitanX (not XP). This is just what we printed in the validate.py, where only the network inference time was counted. The file accesses sometimes affect network inference time as well, so you can bypass the image reader and use random input tensors instead such that the measured time will be very stable.