当前位置:网站首页>Dynamic dimensions required for input: input, but no shapes were provided. Automatically overriding
Dynamic dimensions required for input: input, but no shapes were provided. Automatically overriding
2022-07-05 08:40:00 【Mr.Q】
问题:pth转onnx时设置了动态维度Dynamic dimensions,如下所示
torch.onnx.export(model, input_tensor, output_onnx,
opset_version=12,
do_constant_folding=True,
input_names=["input"],
output_names=["output"],
dynamic_axes={"input": {0: "batch", 2: "height", 3: "width"},
"output": {0: "batch", 2: "height", 3: "width"}},
verbose=False)
但是,onnx转trt时,必须指定推理维度,否则会报warning:
[W] Dynamic dimensions required for input: input, but no shapes were provided. Automatically overriding shape to: 1x3x1x1
输入维度变成了1x3x1x1,显然不对。
解决办法:
需指定维度:
trtexec.exe --onnx=E:\code\python\TensorRT-main\quickstart\SemanticSegmentation\fcn-resnet101.onnx --minShapes=input:1x3x1026x1282 --optShapes=input:1x3x1026x1282 --maxShapes=input:4x3x1026x1282 --workspace=4096 --saveEngine=E:\code\python\TensorRT-main\quickstart\SemanticSegmentation\fcn-resnet101.engine
边栏推荐
- 【三层架构】
- Example 009: pause output for one second
- 猜谜语啦(142)
- MATLAB skills (28) Fuzzy Comprehensive Evaluation
- MySQL MHA high availability cluster
- 剑指 Offer 05. 替换空格
- Array integration initialization (C language)
- [daily training -- Tencent selected 50] 557 Reverse word III in string
- STM32 --- NVIC interrupt
- 第十八章 使用工作队列管理器(一)
猜你喜欢
MATLAB小技巧(28)模糊綜合評價
Example 009: pause output for one second
每日一题——输入一个日期,输出它是该年的第几天
猜谜语啦(2)
Typical low code apaas manufacturer cases
STM32 single chip microcomputer -- debug in keil5 cannot enter the main function
Typescript hands-on tutorial, easy to understand
Daily question - input a date and output the day of the year
猜谜语啦(6)
[matlab] matlab reads and writes Excel
随机推荐
实例001:数字组合 有四个数字:1、2、3、4,能组成多少个互不相同且无重复数字的三位数?各是多少?
实例008:九九乘法表
STM32 single chip microcomputer - external interrupt
Business modeling of software model | vision
Example 007: copy data from one list to another list.
Business modeling | process of software model
猜谜语啦(5)
Bit operation related operations
How to write cover letter?
猜谜语啦(10)
STM32 single chip microcomputer -- volatile keyword
Guess riddles (11)
关于线性稳压器的五个设计细节
Esphone Feixun DC1 soft change access homeassstant
Example 005: three numbers sorting input three integers x, y, Z, please output these three numbers from small to large.
Bluebridge cup internet of things basic graphic tutorial - GPIO output control LD5 on and off
Esphone retrofits old fans
MATLAB小技巧(28)模糊綜合評價
猜谜语啦(3)
Go dependency injection -- Google open source library wire