MaybeShewill-CV / bisenetv2-tensorflow

Unofficial tensorflow implementation of real-time scene image segmentation model "BiSeNet V2: Bilateral Network with Guided Aggregation for Real-time Semantic Segmentation"
https://maybeshewill-cv.github.io/bisenetv2-tensorflow/
MIT License
224 stars 59 forks source link

inference time #38

Closed dmsqlchoi closed 3 years ago

dmsqlchoi commented 3 years ago

In time profile model, you describe 'timeprofile_cityscapes_bisenetv2.py' do

  1. Convert the onnx model into tensorrt engine
  2. Run origin tensorflow frozen model for 500 times to calculate a mean inference time comsuming and fps.
  3. Run accelarated tensorrt engine for 500 times to calculate a mean inference time comsuming and fps.
  4. Calculate the model's gflops statics.

when I try to get inference time, original tensorflow graph(step2 above) and acclerated tensorrt engine(step3 abve) get similar result (inference cost 0.007-0.0080, inference fps 119-130). But according to tensorrt, shouldn't it have a faster speed than the original? Did I misunderstand the description of the steps?

MaybeShewill-CV commented 3 years ago

@dmsqlchoi 1.Trt should have faster speed than original tensorflow. 2.Check if there is something wrong with your local trt.

dmsqlchoi commented 3 years ago

The result of the tensorrt version is fast (120FPS) and there seems to be no problem in local trt. However, it is confirmed that the original tensorflow version also shows the same high speed. Is there any part of the code that needs to be modified in "def time_profile_tensorflow_graph(image_file_path, pb_file_path)"? Can you share your results?

MaybeShewill-CV commented 3 years ago

@dmsqlchoi TRT is 30% faster than origin tf in my local machine:)

dmsqlchoi commented 3 years ago

Thanks! I'll check again!