首页 > 解决方案 > 使用 TensorRT Caffe Parser 解析 Mobilenet-SSD 时出错,“ditcaffe.LayerParameter”没有名为“prior_box_param”的字段

问题描述

我正在使用 TensorRT caffe 解析器从https://github.com/chuanqi305/MobileNet-SSD解析 MobileNet-SSD caffe 模型。我使用 Jetson TX2 中的 Jetpack 3.3 作为平台。如何从 nvinfer 库中修复此错误?API中甚至还有一个 TensorRT 类nvinfer1::plugin::PriorBoxParameters。但是这个图层句柄似乎没有定义。图层参数名称和格式是否有任何错误?或者我们是否必须为此创建一个自定义层插件。有人对此有实现吗?

错误如下,

[libprotobuf ERROR google/protobuf/text_format.cc:298] Error parsing text-format ditcaffe.NetParameter: 1245:18: Message type "ditcaffe.LayerParameter" has no field named "prior_box_param".
ERROR: CaffeParser: Could not parse deploy file

与此错误相关的源代码行,

m_network = m_builder->createNetwork();
m_parser = createCaffeParser();
const IBlobNameToTensor* blobNameToTensor = m_parser->parse(deployFpath, modelFpath, *network, DataType::kFLOAT);

prototxt 文件中给定层的错误,

layer {
  name: "conv11_mbox_priorbox"
  type: "PriorBox"
  bottom: "conv11"
  bottom: "data"
  top: "conv11_mbox_priorbox"
  prior_box_param {
    min_size: 60.0
    aspect_ratio: 2.0
    flip: true
    clip: false
    variance: 0.1
    variance: 0.1
    variance: 0.2
    variance: 0.2
    offset: 0.5
  }
} 

标签: neural-networkcaffeobject-detectiontensorrtnvidia-jetson

解决方案


您必须从 ptototxt 文件中删除所有具有 _param 的块,然后您应该使用插件 API 删除层。访问此链接的讨论以获得清晰的理解:https ://github.com/chenzhi1992/TensorRT-SSD/issues/5


推荐阅读