其实官方已经有了非常详细的教程,https://github.com/NVIDIA/TensorRT;https://github.com/NVIDIA/TensorRT/tree/master/samples/opensource/sampleSSD。但是由于我对神经网络很是不熟悉,所以导致理解有误。
-
设置CUDA_INSTALL_DIR 和 CUDNN_INSTALL_DIR(我设置的是/usr/lib/aarch64-linux-gnu/,官网提供的镜像里并没有和cuda类似的目录,只有lib,没有头文件,不太清楚)。
-
只是想运行一下Demo的话,可以在设置好CUDA_INSTALL_DIR 和CUDNN_INSTALL_DIR之后直接看Prerequisites。
-
需要下载的资源 models_VGGNet_VOC0712_SSD_300x300。上述网站上提供的链接国内不能直接下载,我在网上没有找到免费的,于是找别人帮忙下载的。应该也会保留一段时间,有需要的可以私信我。
-
Edit the deploy.prototxt file and change all the Flatten layers to Reshape operations with the following parameters:
所有type是Flatten ,修改为Reshape,参数也按如下修改。
layer {
name: "conv6_2_mbox_conf_flat"
type: "Reshape"
bottom: "conv6_2_mbox_conf_perm"
top: "conv6_2_mbox_conf_flat"
reshape_param {
shape {
dim: 0
dim: -1
dim: 1
dim: 1
}
}
}
-
Update the detection_out layer to add the keep_count output as expected by the TensorRT DetectionOutput Plugin. top: “keep_count”
意思是新增加一句。我开始理解错了。报错:Plugin layer output count is not equal to caffe output count. -
Some tactics do not have sufficient workspace memory to run.
运行出现这一句,不要担心,我也出现了,好像并不影响。等待稍长一会,就会有结果。 -
运行成功截图。