check allInputDimensionsSpecified() for second profile fail

在使用Yolov7的TensorRT引擎进行预测时遇到错误:[TRT] Parameter check failed at: executionContext.cpp...。问题在于没有为动态维度的输入指定尺寸。在Python中,可以通过在推理前设置输入尺寸解决。对于C++,需要使用IExecutionContext的setBindingDimensions方法来设定动态维度的具体值。通过getBindingDimensions检查维度,并在执行推理前调用setBindingDimensions设置输入尺寸。
摘要由CSDN通过智能技术生成

目录

yolov7 tensorrt预测时报错:

在python代码里,在调用engine推理前做这样的设置即可:

yolov7修改后的tenorrt预测代码:

tensorrt c++预测修改 测试ok


yolov7 tensorrt预测时报错:

[09/09/2022-01:29:24] [TRT] [E] 3: [executionContext.cpp::nvinfer1::rt::ShapeMachineContext::resolveSlots::1480] Error Code 3: API Usage Error (Parameter check failed at: executionContext.cpp::nvinfer1::rt::ShapeMachineContext::resolveSlots::1480, condition: allInputDimensionsSpecified(routine)
)
[09/09/2022-01:29:24] [TRT] [E] 9: [executionContext.cpp::nvinfer1::rt::ExecutionContext::executeInternal::527] Error Code 9: Internal Error (Could not resolve slots: )

下面是作者报的错:

调用具体动态维度的模型engine时如果没有指定维度,会导致报类似这样的错误:

[TRT] Parameter check failed at: engine.cpp::resolveslots::1227, con

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

AI算法网奇

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值