-Replaced ISliceLayer based paddings(reflection,constant and zero) with the IPluginV2 version for TensorRT >= 8.2.0
-Fixed demo build issue on Windows Signed-off-by: perseusdg <harshvardhan.chandira@gmail.com>
This commit is contained in:
committed by
perseusdg
parent
decd73d298
commit
6a133d8dec
+3
-3
@@ -46,9 +46,9 @@ int main(int argc, char *argv[]) {
|
|||||||
std::string cfgPath = YAMLgetConf<std::string>(conf,"cfg_input", "../tests/darknet/cfg/yolo4tiny.cfg");
|
std::string cfgPath = YAMLgetConf<std::string>(conf,"cfg_input", "../tests/darknet/cfg/yolo4tiny.cfg");
|
||||||
std::string namePath = YAMLgetConf<std::string>(conf,"name_input","../tests/darknet/names/coco.names");
|
std::string namePath = YAMLgetConf<std::string>(conf,"name_input","../tests/darknet/names/coco.names");
|
||||||
#elif _WIN32
|
#elif _WIN32
|
||||||
std::string input = YAMLgetConf(conf, "win_input", "..\\..\\..\\demo\\yolo_test.mp4");
|
std::string input = YAMLgetConf<std::string>(conf, "win_input", "..\\..\\..\\demo\\yolo_test.mp4");
|
||||||
std::string cfgPath = YAMLgetConf(conf,"cfg_win_input","..\\..\\..\\tests\\darknet\\cfg\\yolo4tiny.cfg");
|
std::string cfgPath = YAMLgetConf<std::string>(conf,"cfg_win_input","..\\..\\..\\tests\\darknet\\cfg\\yolo4tiny.cfg");
|
||||||
std::string namePath = YAMLgetConf(conf,"name_win_input","..\\..\\..\\tests\\darknet\\names\\coco.names");
|
std::string namePath = YAMLgetConf<std::string>(conf,"name_win_input","..\\..\\..\\tests\\darknet\\names\\coco.names");
|
||||||
#endif
|
#endif
|
||||||
if(!fileExist(input.c_str()))
|
if(!fileExist(input.c_str()))
|
||||||
FatalError("The given input video does not exist.");
|
FatalError("The given input video does not exist.");
|
||||||
|
|||||||
+3
-4
@@ -571,7 +571,7 @@ ILayer* NetworkRT::convert_layer(ITensor *input,Padding *l){
|
|||||||
float(NV_TENSORRT_MINOR)/10 +
|
float(NV_TENSORRT_MINOR)/10 +
|
||||||
float(NV_TENSORRT_PATCH)/100;
|
float(NV_TENSORRT_PATCH)/100;
|
||||||
|
|
||||||
#if ((NV_TENSORRT_MAJOR == 8 && NV_TENSORRT_MINOR >= 2) || NV_TENSORRT_MAJOR > 8)
|
/*#if ((NV_TENSORRT_MAJOR == 8 && NV_TENSORRT_MINOR >= 2) || NV_TENSORRT_MAJOR > 8)
|
||||||
auto *lRT = networkRT->addSlice(*input,Dims3{0,0,0},Dims3{l->output_dim.c,l->output_dim.h,l->output_dim.w},Dims3{0,0,0});
|
auto *lRT = networkRT->addSlice(*input,Dims3{0,0,0},Dims3{l->output_dim.c,l->output_dim.h,l->output_dim.w},Dims3{0,0,0});
|
||||||
if(l->padding_mode == PADDING_MODE_REFLECTION){
|
if(l->padding_mode == PADDING_MODE_REFLECTION){
|
||||||
lRT->setMode(SliceMode::kREFLECT);
|
lRT->setMode(SliceMode::kREFLECT);
|
||||||
@@ -581,8 +581,8 @@ ILayer* NetworkRT::convert_layer(ITensor *input,Padding *l){
|
|||||||
}
|
}
|
||||||
checkNULL(lRT);
|
checkNULL(lRT);
|
||||||
return lRT;
|
return lRT;
|
||||||
#else
|
#else*/
|
||||||
//todo add PADDING_MODE_CONSTANT AND PADDING_MODE_ZERO for tensorrt versions < 8.2
|
//todo use ISliceLayer for padding,currently using ISliceLayer for reflection padding generates an error with monodepth2
|
||||||
if(l->padding_mode == PADDING_MODE_REFLECTION){
|
if(l->padding_mode == PADDING_MODE_REFLECTION){
|
||||||
auto creator = getPluginRegistry()->getPluginCreator("ReflectionPaddingRT_tkDNN","1");
|
auto creator = getPluginRegistry()->getPluginCreator("ReflectionPaddingRT_tkDNN","1");
|
||||||
std::vector<PluginField> mPluginAttributes;
|
std::vector<PluginField> mPluginAttributes;
|
||||||
@@ -624,7 +624,6 @@ ILayer* NetworkRT::convert_layer(ITensor *input,Padding *l){
|
|||||||
|
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ILayer* NetworkRT::convert_layer(ITensor *input, Activation *l) {
|
ILayer* NetworkRT::convert_layer(ITensor *input, Activation *l) {
|
||||||
|
|||||||
Reference in New Issue
Block a user