pytorch模型转成tensorRT后,运行时出现报错:
ERROR: 1: [genericReformat.cu::genericReformat::executeMemcpy::1334] Error Code 1: Cuda Runtime (invalid argument)
后来发现是torch.cat算子引起的,替换成torch.stack后正常
原因还不清楚,可能是tensorRT8的bug,注意避坑
报错的本质是trt不支持cat这个算子,所以需要曲线救国,找个别的办法实现cat的功能