
-
问题一
完整函数是:
irtual IBlobNameToTensor const * nvcaffeparser1::ICaffeParser::parse(char const * deploy,
char const * model,
nvinfer1::INetworkDefinition & network,
nvinfer1::DataType weightType
)
参数一共有四个,分别是
deploy:The plain text, prototxt file used to define the network definition.
model:The binaryproto Caffe model that contains the weights associated with the network.
network:Network in which the CaffeParser will fill the layers.
weight:TypeThe type to which the weights will transformed.
注:caffe格式的模型由两个文件组成,模型结构定义.prototxt和权值文件caffe.model
更详细见nv的文档:https://docs.nvidia.com/deeplearning/tensorrt/archives/tensorrt-861/api/c_api/classnvcaffeparser1_1_1_i_caffe_parser.html#aac5df66d796a4fa7ea91590cb0393681
问题二:
for 循环的目的是需要告诉TensorRT,需要将哪些模型中的Tensor设置为输出节点。
这么设计的原因,是因为在训练过程中,可能会有多个输出,但在推理时,不是所有的输出都是必要的。
-
可以的。本地安装cuda的时候选择自定义。cuda安装包包括tookit,driver,sample等多个部分。
从中间找到nvvp的选项,只安装这个就可以了。
-
后面会有关于使用nvvp进行profile的内容。
nsys是nvvp的升级版,是在比较新的cuda版本中推出的,
两个工具的大体用法差不多。