diff --git a/src/Region.cpp b/src/Region.cpp index 6407eba..56010dd 100644 --- a/src/Region.cpp +++ b/src/Region.cpp @@ -25,7 +25,7 @@ Region::Region(Network *net, int classes, int coords, int num) : output_dim.w = input_dim.w; output_dim.l = input_dim.l; - checkCuda( cudaMalloc(&dstData, input_dim.tot()*sizeof(dnnType)) ); + checkCuda( cudaMalloc(&dstData, output_dim.tot()*sizeof(dnnType)) ); } Region::~Region() { diff --git a/src/Reorg.cpp b/src/Reorg.cpp index 52862b0..67ed011 100644 --- a/src/Reorg.cpp +++ b/src/Reorg.cpp @@ -15,7 +15,7 @@ Reorg::Reorg(Network *net, int stride) : Layer(net) { output_dim.w = input_dim.w/stride; output_dim.l = input_dim.l; - checkCuda( cudaMalloc(&dstData, input_dim.tot()*sizeof(dnnType)) ); + checkCuda( cudaMalloc(&dstData, output_dim.tot()*sizeof(dnnType)) ); } Reorg::~Reorg() { diff --git a/src/Yolo.cpp b/src/Yolo.cpp index 81236aa..6ebfb7c 100644 --- a/src/Yolo.cpp +++ b/src/Yolo.cpp @@ -24,7 +24,7 @@ Yolo::Yolo(Network *net, int classes, int num) : output_dim.w = input_dim.w; output_dim.l = input_dim.l; - checkCuda( cudaMalloc(&dstData, input_dim.tot()*sizeof(dnnType)) ); + checkCuda( cudaMalloc(&dstData, output_dim.tot()*sizeof(dnnType)) ); } Yolo::~Yolo() { diff --git a/tests/yolo3_berkeley/yolo3_berkeley.cpp b/tests/yolo3_berkeley/yolo3_berkeley.cpp index 4653a8b..b8cba69 100644 --- a/tests/yolo3_berkeley/yolo3_berkeley.cpp +++ b/tests/yolo3_berkeley/yolo3_berkeley.cpp @@ -77,7 +77,7 @@ const char *c102_bin = "../tests/yolo3_berkeley/layers/c102.bin"; const char *c103_bin = "../tests/yolo3_berkeley/layers/c103.bin"; const char *c104_bin = "../tests/yolo3_berkeley/layers/c104.bin"; const char *c105_bin = "../tests/yolo3_berkeley/layers/c105.bin"; -const char *output_bin = "../tests/yolo3_berkeley/debug/layer105_out.bin"; +const char *output_bin = "../tests/yolo3_berkeley/debug/layer106_out.bin"; int main() { @@ -234,7 +234,7 @@ int main() { tk::dnn::Conv2d c80 (&net,1024, 3, 3, 1, 1, 1, 1, c80_bin, true); tk::dnn::Activation a80 (&net, tk::dnn::ACTIVATION_LEAKY); tk::dnn::Conv2d c81 (&net, 45, 1, 1, 1, 1, 0, 0, c81_bin, false); -// tk::dnn::Yolo g82 (&net, 10, 9); + tk::dnn::Yolo g82 (&net, 10, 3); tk::dnn::Layer *m83_layers[1] = { &a79 }; tk::dnn::Route m83 (&net, m83_layers, 1); @@ -257,7 +257,7 @@ int main() { tk::dnn::Conv2d c92 (&net, 512, 3, 3, 1, 1, 1, 1, c92_bin, true); tk::dnn::Activation a92 (&net, tk::dnn::ACTIVATION_LEAKY); tk::dnn::Conv2d c93 (&net, 45, 1, 1, 1, 1, 0, 0, c93_bin, false); -// tk::dnn::Yolo g94 (&net, 10, 9); + tk::dnn::Yolo g94 (&net, 10, 3); tk::dnn::Layer *m95_layers[1] = { &a91 }; tk::dnn::Route m95 (&net, m95_layers, 1); @@ -282,7 +282,7 @@ int main() { tk::dnn::Conv2d c104 (&net, 256, 3, 3, 1, 1, 1, 1, c104_bin, true); tk::dnn::Activation a104 (&net, tk::dnn::ACTIVATION_LEAKY); tk::dnn::Conv2d c105 (&net, 45, 1, 1, 1, 1, 0, 0, c105_bin, false); -// tk::dnn::Yolo g106 (&net, 10, 9); + tk::dnn::Yolo g106 (&net, 10, 3); // Load input dnnType *data;