当前位置:网站首页>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
边栏推荐
- 实例003:完全平方数 一个整数,它加上100后是一个完全平方数,再加上168又是一个完全平方数,请问该数是多少?
- Detailed summary of FIO test hard disk performance parameters and examples (with source code)
- Example 010: time to show
- U8g2 drawing
- Example 004: for the day of the day, enter a day of a month of a year to judge the day of the year?
- Typescript hands-on tutorial, easy to understand
- leetcode - 445. Add two numbers II
- 猜谜语啦(9)
- 每日一题——输入一个日期,输出它是该年的第几天
- Guess riddles (6)
猜你喜欢
【NOI模拟赛】汁树(树形DP)
Guess riddles (6)
Example 001: the number combination has four numbers: 1, 2, 3, 4. How many three digits can be formed that are different from each other and have no duplicate numbers? How many are each?
99 multiplication table (C language)
Guess riddles (9)
MATLAB小技巧(28)模糊综合评价
Pytorch entry record
MHA High available Cluster for MySQL
UE pixel stream, come to a "diet pill"!
每日一题——输入一个日期,输出它是该年的第几天
随机推荐
Example 009: pause output for one second
Program error record 1:valueerror: invalid literal for int() with base 10: '2.3‘
Several problems to be considered and solved in the design of multi tenant architecture
2022.7.4-----leetcode.1200
An enterprise information integration system
Arduino operation stm32
Run菜单解析
C language data type replacement
Shift operation of complement
Count the number of inputs (C language)
【三层架构】
Agile project management of project management
猜谜语啦(7)
C语言标准函数scanf不安全的原因
Typical low code apaas manufacturer cases
關於線性穩壓器的五個設計細節
Sword finger offer 05 Replace spaces
Low code platform | apaas platform construction analysis
MATLAB skills (28) Fuzzy Comprehensive Evaluation
猜谜语啦(4)