当前位置:网站首页>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
边栏推荐
- Guess riddles (7)
- 剑指 Offer 09. 用两个栈实现队列
- Low code platform | apaas platform construction analysis
- Count the number of inputs (C language)
- Several problems to be considered and solved in the design of multi tenant architecture
- Infected Tree(树形dp)
- 实例008:九九乘法表
- STM32 --- GPIO configuration & GPIO related library functions
- [three tier architecture and JDBC summary]
- STM32 single chip microcomputer -- debug in keil5 cannot enter the main function
猜你喜欢
Meizu Bluetooth remote control temperature and humidity access homeassistant
Digital analog 1: linear programming
How to write cover letter?
Sword finger offer 09 Implementing queues with two stacks
An enterprise information integration system
Guess riddles (7)
Xrosstools tool installation for X-Series
How apaas is applied in different organizational structures
Guess riddles (142)
[three tier architecture]
随机推荐
Detailed summary of FIO test hard disk performance parameters and examples (with source code)
MHA High available Cluster for MySQL
Example 009: pause output for one second
Digital analog 1: linear programming
[daily training] 1200 Minimum absolute difference
实例001:数字组合 有四个数字:1、2、3、4,能组成多少个互不相同且无重复数字的三位数?各是多少?
Classification of plastic surgery: short in long long long
Infix expression evaluation
[matlab] matlab reads and writes Excel
Guess riddles (6)
Cinq détails de conception du régulateur de tension linéaire
Basic number theory - factors
287. Looking for repeats - fast and slow pointer
Esp8266 interrupt configuration
Example 005: three numbers sorting input three integers x, y, Z, please output these three numbers from small to large.
Low code platform | apaas platform construction analysis
STM32 lights up the 1.8-inch screen under Arduino IDE
Infected Tree(树形dp)
Various types of questions judged by prime numbers within 100 (C language)
Sword finger offer 05 Replace spaces