tensorrtx icon indicating copy to clipboard operation
tensorrtx copied to clipboard

虽然最终得到了engine模型,但是报了这个错误,我是否应该忽视

Open 22ling opened this issue 1 year ago • 2 comments

Env

  • GPU3090ti
  • Win11
  • Cuda version:11.8
  • TensorRT version:8.6.1.6

About this repo

  • tag: yolov5s v6.0
  • yolov5

My problem

  • my command: yolov5.exe -s yolo5_wc_10_5x5.wts yolov5_4x5_bt256.engine s

  • what's your output? [06/04/2024-10:20:35] [W] [TRT] The implicit batch dimension mode has been deprecated. Please create the network with NetworkDefinitionCreationFlag::kEXPLICIT_BATCH flag whenever possible. Loading weights: yolo5_wc_10_5x5.wts Building engine, please wait for a while... [06/04/2024-10:27:06] [W] [TRT] TensorRT encountered issues when converting weights between types and that could affect accuracy. [06/04/2024-10:27:06] [W] [TRT] If this is not the desired behavior, please modify the weights or retrain with regularization to adjust the magnitude of the weights. [06/04/2024-10:27:06] [W] [TRT] Check verbose logs for the list of affected weights. [06/04/2024-10:27:06] [W] [TRT] - 50 weights are affected by this issue: Detected subnormal FP16 values. [06/04/2024-10:27:06] [W] [TRT] - 2 weights are affected by this issue: Detected values less than smallest positive FP16 subnormal value and converted them to the FP16 minimum subnormalized value. Build engine successfully! [06/04/2024-10:27:06] [E] [TRT] 3: [builder.cpp::nvinfer1::builder::Builder::~Builder::341] Error Code 3: API Usage Error (Parameter check failed at: builder.cpp::nvinfer1::builder::Builder::~Builder::341, condition: mObjectCounter.use_count() == 1. Destroying a builder object before destroying objects it created leads to undefined behavior. )

  • what output do you expect? why appear"[06/04/2024-10:27:06] [E] [TRT] 3: [builder.cpp::nvinfer1::builder::Builder::~Builder::341] Error Code 3: API Usage Error (Parameter check failed at: builder.cpp::nvinfer1::builder::Builder::~Builder::341, condition: mObjectCounter.use_count() == 1. Destroying a builder object before destroying objects it created leads to undefined behavior. )",shouild i ignore or take some meatures?

22ling avatar Jun 04 '24 02:06 22ling

@22ling

trt版本更新到8.5之后的问题。

主要是CUDA释放内存顺序不对,需要看一下在定义builder、engine、runtime指针时的顺序,在释放内存时,需要倒序释放,还要看看你有没有定义二级指针,destroy的时候也要注意释放的顺序

arkerman avatar Jun 04 '24 03:06 arkerman

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Sep 06 '24 02:09 stale[bot]