From 89f91f568e847632b831bd2a83931bafb1887806 Mon Sep 17 00:00:00 2001 From: Micaela Verucchi Date: Tue, 28 Apr 2020 14:34:12 +0200 Subject: [PATCH] Fix shortcutRT plugin, now works with batches, fix yolo3_512 downlaod link Signed-off-by: Micaela Verucchi --- include/tkDNN/pluginsRT/ShortcutRT.h | 3 ++- tests/yolo3_512/yolo3_512.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/include/tkDNN/pluginsRT/ShortcutRT.h b/include/tkDNN/pluginsRT/ShortcutRT.h index fd2c60d..3eadd3f 100644 --- a/include/tkDNN/pluginsRT/ShortcutRT.h +++ b/include/tkDNN/pluginsRT/ShortcutRT.h @@ -47,7 +47,8 @@ public: dnnType *dstData = reinterpret_cast(outputs[0]); checkCuda( cudaMemcpyAsync(dstData, srcData, batchSize*c*h*w*sizeof(dnnType), cudaMemcpyDeviceToDevice, stream)); - shortcutForward(srcDataBack, dstData, batchSize, c, h, w, 1, batchSize, bc, bh, bw, 1, stream); + for(int b=0; b < batchSize; ++b) + shortcutForward(srcDataBack + b*bc*bh*bw, dstData + b*c*h*w, 1, c, h, w, 1, 1, bc, bh, bw, 1, stream); return 0; } diff --git a/tests/yolo3_512/yolo3_512.cpp b/tests/yolo3_512/yolo3_512.cpp index cb50410..5e796c1 100644 --- a/tests/yolo3_512/yolo3_512.cpp +++ b/tests/yolo3_512/yolo3_512.cpp @@ -10,7 +10,7 @@ int main() { // create yolo3 model std::string bin_path = "yolo3_512"; - downloadWeightsifDoNotExist("yolo3_512/layers/input.bin", bin_path, "https://cloud.hipert.unimore.it/s/e7HfScx77JEHeYb/download"); + downloadWeightsifDoNotExist("yolo3_512/layers/input.bin", bin_path, "https://cloud.hipert.unimore.it/s/RGecMeGLD4cXEWL/download"); int classes = 80; tk::dnn::Yolo *yolo [3]; #include "models/Yolo3.h"