From 4f52dd501aa15c85ad395d58ce934e70570df565 Mon Sep 17 00:00:00 2001 From: xiaxy <529379497@qq.com> Date: Wed, 7 Jun 2023 21:09:21 +0800 Subject: [PATCH] fix trtModelStream release --- csrc/detect/end2end/include/yolov8.hpp | 2 +- csrc/detect/normal/include/yolov8.hpp | 2 +- csrc/jetson/detect/include/yolov8.hpp | 2 +- csrc/jetson/pose/include/yolov8-pose.hpp | 2 +- csrc/jetson/segment/include/yolov8-seg.hpp | 2 +- csrc/pose/normal/include/yolov8-pose.hpp | 2 +- csrc/segment/normal/include/yolov8-seg.hpp | 2 +- csrc/segment/simple/include/yolov8-seg.hpp | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/csrc/detect/end2end/include/yolov8.hpp b/csrc/detect/end2end/include/yolov8.hpp index b219cf2..c08a8e9 100644 --- a/csrc/detect/end2end/include/yolov8.hpp +++ b/csrc/detect/end2end/include/yolov8.hpp @@ -66,7 +66,7 @@ YOLOv8::YOLOv8(const std::string& engine_file_path) this->engine = this->runtime->deserializeCudaEngine(trtModelStream, size); assert(this->engine != nullptr); - + delete[] trtModelStream; this->context = this->engine->createExecutionContext(); assert(this->context != nullptr); diff --git a/csrc/detect/normal/include/yolov8.hpp b/csrc/detect/normal/include/yolov8.hpp index b6f57dd..535e543 100644 --- a/csrc/detect/normal/include/yolov8.hpp +++ b/csrc/detect/normal/include/yolov8.hpp @@ -72,7 +72,7 @@ YOLOv8::YOLOv8(const std::string& engine_file_path) this->engine = this->runtime->deserializeCudaEngine(trtModelStream, size); assert(this->engine != nullptr); - + delete[] trtModelStream; this->context = this->engine->createExecutionContext(); assert(this->context != nullptr); diff --git a/csrc/jetson/detect/include/yolov8.hpp b/csrc/jetson/detect/include/yolov8.hpp index 2c0750a..739e024 100644 --- a/csrc/jetson/detect/include/yolov8.hpp +++ b/csrc/jetson/detect/include/yolov8.hpp @@ -66,7 +66,7 @@ YOLOv8::YOLOv8(const std::string& engine_file_path) this->engine = this->runtime->deserializeCudaEngine(trtModelStream, size); assert(this->engine != nullptr); - + delete[] trtModelStream; this->context = this->engine->createExecutionContext(); assert(this->context != nullptr); diff --git a/csrc/jetson/pose/include/yolov8-pose.hpp b/csrc/jetson/pose/include/yolov8-pose.hpp index 4a04584..b53a25f 100644 --- a/csrc/jetson/pose/include/yolov8-pose.hpp +++ b/csrc/jetson/pose/include/yolov8-pose.hpp @@ -80,7 +80,7 @@ YOLOv8_pose::YOLOv8_pose(const std::string &engine_file_path) { this->engine = this->runtime->deserializeCudaEngine(trtModelStream, size); assert(this->engine != nullptr); - + delete[] trtModelStream; this->context = this->engine->createExecutionContext(); assert(this->context != nullptr); diff --git a/csrc/jetson/segment/include/yolov8-seg.hpp b/csrc/jetson/segment/include/yolov8-seg.hpp index ec855d7..259c389 100644 --- a/csrc/jetson/segment/include/yolov8-seg.hpp +++ b/csrc/jetson/segment/include/yolov8-seg.hpp @@ -76,7 +76,7 @@ YOLOv8_seg::YOLOv8_seg(const std::string& engine_file_path) this->engine = this->runtime->deserializeCudaEngine(trtModelStream, size); assert(this->engine != nullptr); - + delete[] trtModelStream; this->context = this->engine->createExecutionContext(); assert(this->context != nullptr); diff --git a/csrc/pose/normal/include/yolov8-pose.hpp b/csrc/pose/normal/include/yolov8-pose.hpp index fa3541e..1280df4 100644 --- a/csrc/pose/normal/include/yolov8-pose.hpp +++ b/csrc/pose/normal/include/yolov8-pose.hpp @@ -80,7 +80,7 @@ YOLOv8_pose::YOLOv8_pose(const std::string &engine_file_path) { this->engine = this->runtime->deserializeCudaEngine(trtModelStream, size); assert(this->engine != nullptr); - + delete[] trtModelStream; this->context = this->engine->createExecutionContext(); assert(this->context != nullptr); diff --git a/csrc/segment/normal/include/yolov8-seg.hpp b/csrc/segment/normal/include/yolov8-seg.hpp index ae26993..80691f8 100644 --- a/csrc/segment/normal/include/yolov8-seg.hpp +++ b/csrc/segment/normal/include/yolov8-seg.hpp @@ -76,7 +76,7 @@ YOLOv8_seg::YOLOv8_seg(const std::string& engine_file_path) this->engine = this->runtime->deserializeCudaEngine(trtModelStream, size); assert(this->engine != nullptr); - + delete[] trtModelStream; this->context = this->engine->createExecutionContext(); assert(this->context != nullptr); diff --git a/csrc/segment/simple/include/yolov8-seg.hpp b/csrc/segment/simple/include/yolov8-seg.hpp index a8d9fee..b8640c9 100644 --- a/csrc/segment/simple/include/yolov8-seg.hpp +++ b/csrc/segment/simple/include/yolov8-seg.hpp @@ -76,7 +76,7 @@ YOLOv8_seg::YOLOv8_seg(const std::string& engine_file_path) this->engine = this->runtime->deserializeCudaEngine(trtModelStream, size); assert(this->engine != nullptr); - + delete[] trtModelStream; this->context = this->engine->createExecutionContext(); assert(this->context != nullptr);