Open FeiYull opened 4 months ago
reference: https://github.com/FeiYull/TensorRT-Alpha/issues/91#issuecomment-1970319941
FeiYull @.***
------------------ Original ------------------ From: Myreaeee @.> Date: Thu,Mar 7,2024 5:21 PM To: FeiYull/TensorRT-Alpha @.> Cc: FeiYull @.>, Author @.> Subject: Re: [FeiYull/TensorRT-Alpha] warning:[E] [TRT] 3:[runtime.cpp::~Runtime::346] Error Code 3: API Usage Error (Parameter checkfailed at: runtime/rt/runtime.cpp::~Runtime::346, condition:mEngineCounter.use_count() == 1. Destroying a runtime before destroyingdeserialized engines created by the runtime leads to undefined behavior.(Issue #90)
i have added codes in yolo.h, why it still didnot work
protected:
std::unique_ptrnvinfer1::IRuntime runtime;
std::shared_ptrnvinfer1::ICudaEngine m_engine;
std::unique_ptrnvinfer1::IExecutionContext m_context;
protected:
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: @.***>
warning:[E] [TRT] 3: [runtime.cpp::~Runtime::346] Error Code 3: API Usage Error (Parameter check failed at: runtime/rt/runtime.cpp::~Runtime::346, condition: mEngineCounter.use_count() == 1. Destroying a runtime before destroying deserialized engines created by the runtime leads to undefined behavior.
[solution]:eg: 更换声明下面runtime变量到新的位置
runtime原始声明位置: https://github.com/FeiYull/TensorRT-Alpha/blob/87fdb72056682835ab06e417f7d51f483e197ebf/yolov8/yolov8.cpp#L19
runtime新的原始声明位置: https://github.com/FeiYull/TensorRT-Alpha/blob/87fdb72056682835ab06e417f7d51f483e197ebf/utils/yolo.h#L26