当前位置:网站首页>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边栏推荐
- Array integration initialization (C language)
- 实例008:九九乘法表
- Classification of plastic surgery: short in long long long
- STM32 single chip microcomputer -- volatile keyword
- 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?
- STM32 single chip microcomputer - external interrupt
- Guess riddles (3)
- 【NOI模拟赛】汁树(树形DP)
- Example 007: copy data from one list to another list.
- How apaas is applied in different organizational structures
猜你喜欢

leetcode - 445. 两数相加 II

One question per day - replace spaces

Guess riddles (10)

实例004:这天第几天 输入某年某月某日,判断这一天是这一年的第几天?
![[three tier architecture and JDBC summary]](/img/e0/13d48f2e59b445b9e28e38d45f492d.png)
[three tier architecture and JDBC summary]

实例007:copy 将一个列表的数据复制到另一个列表中。

STM32 lights up the 1.8-inch screen under Arduino IDE

Guess riddles (3)

Numpy pit: after the addition of dimension (n, 1) and dimension (n,) array, the dimension becomes (n, n)

Guess riddles (11)
随机推荐
[NAS1](2021CVPR)AttentiveNAS: Improving Neural Architecture Search via Attentive Sampling (未完)
剑指 Offer 09. 用两个栈实现队列
One question per day - replace spaces
Guess riddles (10)
Agile project management of project management
U8g2 drawing
696. Count binary substring
Business modeling of software model | vision
[nas1] (2021cvpr) attentivenas: improving neural architecture search via attentive sampling (unfinished)
Old Wang's esp8266 and old Wu's ws2818 light strip
Lori remote control LEGO motor
Wheel 1:qcustomplot initialization template
TypeScript手把手教程,简单易懂
Stm32--- systick timer
实例009:暂停一秒输出
STM32 --- NVIC interrupt
319. 灯泡开关
[daily training -- Tencent selected 50] 557 Reverse word III in string
Lori remote control commissioning record
319. Bulb switch