From ba8199a03088b7c8e36066a1636a1237ab316cec Mon Sep 17 00:00:00 2001 From: Francesco Gatti Date: Sun, 16 May 2021 22:33:45 +0200 Subject: [PATCH] fix compile error on old tensorrt and remove useless prints --- include/tkDNN/pluginsRT/YoloRT.h | 24 ++++++++++++------------ src/NetworkRT.cpp | 4 ++-- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/include/tkDNN/pluginsRT/YoloRT.h b/include/tkDNN/pluginsRT/YoloRT.h index 2911869..5ffe39c 100644 --- a/include/tkDNN/pluginsRT/YoloRT.h +++ b/include/tkDNN/pluginsRT/YoloRT.h @@ -93,23 +93,23 @@ public: virtual void serialize(void* buffer) override { char *buf = reinterpret_cast(buffer),*a=buf; - tk::dnn::writeBUF(buf, classes); std::cout << "Classes :" << classes << std::endl; - tk::dnn::writeBUF(buf, num); std::cout << "Num : " << num << std::endl; - tk::dnn::writeBUF(buf, n_masks); std::cout << "N_Masks" << n_masks << std::endl; - tk::dnn::writeBUF(buf, scaleXY); std::cout << "ScaleXY :" << scaleXY << std::endl; - tk::dnn::writeBUF(buf, nms_thresh); std::cout << "nms_thresh :" << nms_thresh << std::endl; - tk::dnn::writeBUF(buf, nms_kind); std::cout << "nms_kind : " << nms_kind << std::endl; - tk::dnn::writeBUF(buf, new_coords); std::cout << "new_coords : " << new_coords << std::endl; - tk::dnn::writeBUF(buf, c); std::cout << "C : " << c << std::endl; - tk::dnn::writeBUF(buf, h); std::cout << "H : " << h << std::endl; - tk::dnn::writeBUF(buf, w); std::cout << "C : " << c << std::endl; + tk::dnn::writeBUF(buf, classes); //std::cout << "Classes :" << classes << std::endl; + tk::dnn::writeBUF(buf, num); //std::cout << "Num : " << num << std::endl; + tk::dnn::writeBUF(buf, n_masks); //std::cout << "N_Masks" << n_masks << std::endl; + tk::dnn::writeBUF(buf, scaleXY); //std::cout << "ScaleXY :" << scaleXY << std::endl; + tk::dnn::writeBUF(buf, nms_thresh); //std::cout << "nms_thresh :" << nms_thresh << std::endl; + tk::dnn::writeBUF(buf, nms_kind); //std::cout << "nms_kind : " << nms_kind << std::endl; + tk::dnn::writeBUF(buf, new_coords); //std::cout << "new_coords : " << new_coords << std::endl; + tk::dnn::writeBUF(buf, c); //std::cout << "C : " << c << std::endl; + tk::dnn::writeBUF(buf, h); //std::cout << "H : " << h << std::endl; + tk::dnn::writeBUF(buf, w); //std::cout << "C : " << c << std::endl; for (int i = 0; i < n_masks; i++) { - tk::dnn::writeBUF(buf, mask[i]); std::cout << "mask[i] : " << mask[i] << std::endl; + tk::dnn::writeBUF(buf, mask[i]); //std::cout << "mask[i] : " << mask[i] << std::endl; } for (int i = 0; i < n_masks * 2 * num; i++) { - tk::dnn::writeBUF(buf, bias[i]); std::cout << "bias[i] : " << bias[i] << std::endl; + tk::dnn::writeBUF(buf, bias[i]); //std::cout << "bias[i] : " << bias[i] << std::endl; } // save classes names diff --git a/src/NetworkRT.cpp b/src/NetworkRT.cpp index 320c3ea..a95423d 100644 --- a/src/NetworkRT.cpp +++ b/src/NetworkRT.cpp @@ -139,8 +139,8 @@ NetworkRT::NetworkRT(Network *net, const char *name) { #if NV_TENSORRT_MAJOR >= 6 engineRT = builderRT->buildEngineWithConfig(*networkRT, *configRT); #else - //engineRT = builderRT->buildCudaEngine(*networkRT); - engineRT = std::shared_ptr(builderRT->buildCudaEngine(*networkRT)); + engineRT = builderRT->buildCudaEngine(*networkRT); + //engineRT = std::shared_ptr(builderRT->buildCudaEngine(*networkRT)); #endif if(engineRT == nullptr) FatalError("cloud not build cuda engine")