Shelfnet works, also visualization. Postprocessing need to be parallelized

Signed-off-by: Micaela Verucchi <micaelaverucchi@gmail.com>
This commit is contained in:
Micaela Verucchi
2020-06-23 20:01:47 +02:00
parent 94e558003d
commit 082920f3f5
12 changed files with 366 additions and 20 deletions
+4 -4
View File
@@ -191,7 +191,7 @@ int main()
down_out.push_back(l_last);
new tk::dnn::Conv2d (&net, out_channel*2, 3, 3, 2, 2, 1, 1, ladder[li++], false);
last = new tk::dnn::Activation (&net, CUDNN_ACTIVATION_RELU);
last = new tk::dnn::Activation (&net, tk::dnn::ACTIVATION_LEAKY, 0.0f, 0.0f); //should be ReLU
}
new tk::dnn::Conv2d (&net, 256, 3, 3, 1, 1, 1, 1, ladder[li++], true, false, 1, true);
@@ -231,12 +231,12 @@ int main()
new tk::dnn::Conv2d (&net, 64, 3, 3, 1, 1, 1, 1, conv_out[ci++], true);
new tk::dnn::Activation (&net, tk::dnn::ACTIVATION_LEAKY, 0.0f, 0.01);
new tk::dnn::Conv2d (&net, 19, 3, 3, 1, 1, 1, 1, conv_out[ci++], false);
// /*up_out[i] =*/ new tk::dnn::Resize(&net, 19, net.input_dim.h, net.input_dim.w, true);
/*up_out[i] =*/ new tk::dnn::Resize(&net, 19, net.input_dim.h, net.input_dim.w, true, tk::dnn::ResizeMode_t::LINEAR);
// }
// new tk::dnn::Softmax(&net);
new tk::dnn::Softmax(&net);
const char *output_bin = "shelfnet/debug/conv_out-conv_out.bin";
const char *output_bin = "shelfnet/debug/softmax.bin";
// Load input
dnnType *data;
+2 -2
View File
@@ -31,7 +31,7 @@ int main(int argc, char *argv[]) {
std::cout<<"Testing with batchsize: "<<BATCH_SIZE<<"\n";
printCenteredTitle(" TENSORRT inference ", '=', 30);
float total_time = 0;
for(int i=0; i<1200; i++) {
for(int i=0; i<64; i++) {
// generate input
for(int j=0; j<netRT.input_dim.tot(); j++) {
@@ -58,6 +58,6 @@ int main(int argc, char *argv[]) {
}
}
}
std::cout<<"avg: "<<total_time/1200.<<std::endl;
std::cout<<"avg: "<<total_time/64.<<std::endl;
return ret_tensorrt;
}