tiny yolo not working

This commit is contained in:
Francesco Gatti
2017-08-07 15:05:48 +02:00
parent 34198a4e8d
commit 7d570c0df4
6 changed files with 112 additions and 14 deletions
+3 -2
View File
@@ -32,9 +32,10 @@ Network::~Network() {
value_type* Network::infer(dataDim_t &dim, value_type* data) {
//do infer for every layer
for(int i=0; i<num_layers; i++)
for(int i=0; i<num_layers; i++) {
data = layers[i]->infer(dim, data);
//dim.print();
}
checkCuda(cudaDeviceSynchronize());
return data;
}
+5 -1
View File
@@ -45,7 +45,11 @@ NetworkRT::NetworkRT(Network *net) {
}
if(input == NULL)
FatalError("conversion failed");
output_dim = net->layers[net->num_layers-1]->output_dim;
output_dim = dim;
Dims oDim = input->getDimensions();
output_dim.c = oDim.d[0];
output_dim.h = oDim.d[1];
output_dim.w = oDim.d[2];
//build tensorRT
input->setName("out");
+9 -10
View File
@@ -5,20 +5,18 @@
namespace tkDNN {
Pooling::Pooling( Network *net, int winH, int winW,
int strideH, int strideW, tkdnnPoolingMode_t pool_mode) :
Pooling::Pooling( Network *net, int winH, int winW, int strideH, int strideW,
tkdnnPoolingMode_t pool_mode) :
Layer(net) {
if(winH != strideH || winW != strideW)
FatalError("stride pooling not yet implemented");
this->winH = winH;
this->winW = winW;
this->strideH = strideH;
this->strideW = strideW;
this->pool_mode = pool_mode;
this->paddingH = 0;
this->paddingW = 0;
checkCUDNN( cudnnCreatePoolingDescriptor(&poolingDesc) );
int n = input_dim.n;
@@ -46,12 +44,13 @@ Pooling::Pooling( Network *net, int winH, int winW,
net->tensorFormat, net->dataType, n, c, h, w) );
//get out dim
h = h / winH; w = w / winW;
checkCUDNN( cudnnGetPooling2dForwardOutputDim(poolingDesc, srcTensorDesc, &n, &c, &h, &w));
//h = (h + winH*this->paddingH)/strideH;
//w = (w + winW*this->paddingW)/strideW;
checkCUDNN( cudnnSetTensor4dDescriptor(dstTensorDesc,
net->tensorFormat, net->dataType, n, c, h, w) );
output_dim.n = n;
output_dim.c = c;
output_dim.h = h;