我正在使用带有 Jetpack 4.2.1 的 Jetson AGX Xavier
我没有更改 Tensor RT、UFF 和 graphsurgeon 版本。他们就是这样。
我在自定义 600x600 图像上重新训练了 SSD Inception v2 模型。
我在 pipeline.config 中将高度和宽度更改为 600x600。
我正在使用包含 Tensor RT 样本的 sampleUffSSD 样本。
在 config.py 中,我将 300 替换为 600 的形状。
我通过命令生成了frozen_graph.uff:python3 convert_to_uff.py freeze_inference_graph.pb -O NMS -p config.py
在文件 BatchStreamPPM.h 中:
我变了
static constexpr int INPUT_H = 600; // replaced 300 by 600
static constexpr int INPUT_W = 600; // replaced 300 by 600
mDims = nvinfer1::DimsNCHW{batchSize, 3, 600, 600}; // replaced 300 by 600
在文件 sampleUffSSD.cpp
我变了
parser->registerInput("Input", DimsCHW(3, 600,600), UffInputOrder::kNCHW); // replaced 300 by 600
cd sampleUffSSD
使清洁;制作
我跑了 sample_uff_ssd 我遇到了以下错误:
&&&& RUNNING TensorRT.sample_uff_ssd # ./../../bin/sample_uff_ssd [I] ../../data/ssd/sample_ssd_relu6.uff [I] 开始解析模型... [I] 结束解析模型.. . [I] 开始构建引擎... sample_uff_ssd: nmsPlugin.cpp:139: virtual void nvinfer1::plugin::DetectionOutput::configureWithFormat(const nvinfer1::Dims*, int, const nvinfer1::Dims*, int, nvinfer1 ::DataType, nvinfer1::PluginFormat, int): 断言 `numPriors * numLocClasses * 4 == inputDims[param.inputOrder[0]].d[0]' 失败。中止(核心转储)
我认为问题在于分辨率。
如何优化自定义分辨率的模型?
它适用于 300x300 分辨率。