From 57d7743f7e950a9d72870ea811758cd156775403 Mon Sep 17 00:00:00 2001 From: xavier Date: Wed, 15 Jan 2020 09:55:10 +0100 Subject: [PATCH 1/2] Change opencv funcion call (due to OpenCV 4) Signed-off-by: xavier --- demo/demo/demo.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/demo/demo/demo.cpp b/demo/demo/demo.cpp index ac6c63d..3a9ef6e 100644 --- a/demo/demo/demo.cpp +++ b/demo/demo/demo.cpp @@ -7,6 +7,7 @@ #include #include +#include #include #include "Yolo3Detection.h" @@ -46,9 +47,9 @@ int main(int argc, char *argv[]) { cv::VideoWriter resultVideo; if(SAVE_RESULT) { - int w = cap.get(CV_CAP_PROP_FRAME_WIDTH); - int h = cap.get(CV_CAP_PROP_FRAME_HEIGHT); - resultVideo.open("result.mp4", CV_FOURCC('M','P','4','V'), 30, cv::Size(w, h)); + int w = cap.get(cv::CAP_PROP_FRAME_WIDTH); + int h = cap.get(cv::CAP_PROP_FRAME_HEIGHT); + resultVideo.open("result.mp4", cv::VideoWriter::fourcc('M','P','4','V'), 30, cv::Size(w, h)); } cv::Mat frame; From c32a0be257acb29cbe4f4ef20be1bc80027a3475 Mon Sep 17 00:00:00 2001 From: xavier Date: Wed, 15 Jan 2020 18:06:02 +0100 Subject: [PATCH 2/2] Batchnorm eps fix, works on jetpack 4.3 --- README.md | 7 ++++--- include/tkDNN/Layer.h | 2 ++ src/Conv2d.cpp | 2 +- src/LayerWgs.cpp | 2 +- src/Network.cpp | 9 +++++---- 5 files changed, 13 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 93a7574..3b16ec3 100644 --- a/README.md +++ b/README.md @@ -3,9 +3,10 @@ tkDNN is a Deep Neural Network library built with cuDNN primitives specifically The main scope is to do high performance inference on already trained models. this branch actually work on every NVIDIA GPU that support the dependencies: -* CUDA 9 -* CUDNN 7.105 -* TENSORRT 4.02 +* CUDA 10.0 +* CUDNN 7.603 +* TENSORRT 6.01 +* OPENCV 4.1 ## Workflow The recommended workflow follow these step: diff --git a/include/tkDNN/Layer.h b/include/tkDNN/Layer.h index c6bee42..ee73109 100644 --- a/include/tkDNN/Layer.h +++ b/include/tkDNN/Layer.h @@ -24,6 +24,8 @@ enum layerType_t { LAYER_YOLO }; +#define TKDNN_BN_MIN_EPSILON 1e-5 + /** Simple layer Father class */ diff --git a/src/Conv2d.cpp b/src/Conv2d.cpp index 3dfdce6..b275198 100644 --- a/src/Conv2d.cpp +++ b/src/Conv2d.cpp @@ -117,7 +117,7 @@ dnnType* Conv2d::infer(dataDim_t &dim, dnnType* srcData) { dstTensorDesc, dstData, dstTensorDesc, dstData, biasTensorDesc, //same tensor descriptor as bias scales_d, bias_d, mean_d, variance_d, - CUDNN_BN_MIN_EPSILON); + TKDNN_BN_MIN_EPSILON); } //update data dimensions dim = output_dim; diff --git a/src/LayerWgs.cpp b/src/LayerWgs.cpp index f27da0f..7851164 100644 --- a/src/LayerWgs.cpp +++ b/src/LayerWgs.cpp @@ -29,7 +29,7 @@ LayerWgs::LayerWgs(Network *net, int inputs, int outputs, seek += outputs; readBinaryFile(weights_path.c_str(), outputs, &variance_h, &variance_d, seek); - float eps = CUDNN_BN_MIN_EPSILON; + float eps = TKDNN_BN_MIN_EPSILON; power_h = new dnnType[outputs]; for(int i=0; i