Fix YOLO kernels
- Fix YOLO kernels - Update deprecated functions
This commit is contained in:
@@ -164,13 +164,13 @@ nvinfer1::ILayer* convolutionalLayer(
|
||||
}
|
||||
}
|
||||
|
||||
nvinfer1::IConvolutionLayer* conv = network->addConvolution(
|
||||
nvinfer1::IConvolutionLayer* conv = network->addConvolutionNd(
|
||||
*input, filters, nvinfer1::DimsHW{kernelSize, kernelSize}, convWt, convBias);
|
||||
assert(conv != nullptr);
|
||||
std::string convLayerName = "conv_" + std::to_string(layerIdx);
|
||||
conv->setName(convLayerName.c_str());
|
||||
conv->setStride(nvinfer1::DimsHW{stride, stride});
|
||||
conv->setPadding(nvinfer1::DimsHW{pad, pad});
|
||||
conv->setStrideNd(nvinfer1::DimsHW{stride, stride});
|
||||
conv->setPaddingNd(nvinfer1::DimsHW{pad, pad});
|
||||
|
||||
if (block.find("groups") != block.end())
|
||||
{
|
||||
|
||||
@@ -19,10 +19,10 @@ nvinfer1::ILayer* maxpoolLayer(
|
||||
int stride = std::stoi(block.at("stride"));
|
||||
|
||||
nvinfer1::IPoolingLayer* pool
|
||||
= network->addPooling(*input, nvinfer1::PoolingType::kMAX, nvinfer1::DimsHW{size, size});
|
||||
= network->addPoolingNd(*input, nvinfer1::PoolingType::kMAX, nvinfer1::DimsHW{size, size});
|
||||
assert(pool);
|
||||
std::string maxpoolLayerName = "maxpool_" + std::to_string(layerIdx);
|
||||
pool->setStride(nvinfer1::DimsHW{stride, stride});
|
||||
pool->setStrideNd(nvinfer1::DimsHW{stride, stride});
|
||||
pool->setPaddingMode(nvinfer1::PaddingMode::kSAME_UPPER);
|
||||
pool->setName(maxpoolLayerName.c_str());
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ nvinfer1::ILayer* upsampleLayer(
|
||||
|
||||
nvinfer1::IResizeLayer* resize_layer = network->addResize(*input);
|
||||
resize_layer->setResizeMode(nvinfer1::ResizeMode::kNEAREST);
|
||||
float scale[3] = {1, stride, stride};
|
||||
float scale[3] = {1, static_cast<float>(stride), static_cast<float>(stride)};
|
||||
resize_layer->setScales(scale, 3);
|
||||
std::string layer_name = "upsample_" + std::to_string(layerIdx);
|
||||
resize_layer->setName(layer_name.c_str());
|
||||
|
||||
Reference in New Issue
Block a user