当前位置:网站首页>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边栏推荐
猜你喜欢

Sword finger offer 06 Print linked list from end to end
AttentiveNAS: Improving Neural Architecture Search via Attentive Sampling (未完)](/img/3b/c94b8466370f4461875c85b4f66860.png)
[NAS1](2021CVPR)AttentiveNAS: Improving Neural Architecture Search via Attentive Sampling (未完)

MHA High available Cluster for MySQL

Guess riddles (142)

MySQL MHA high availability cluster

Business modeling of software model | overview

Shell script

319. Bulb switch

Example 010: time to show

Typical low code apaas manufacturer cases
随机推荐
Array integration initialization (C language)
Cmder of win artifact
【日常訓練--騰訊精選50】557. 反轉字符串中的單詞 III
STM32 summary (HAL Library) - DHT11 temperature sensor (intelligent safety assisted driving system)
STM32 --- NVIC interrupt
Arduino operation stm32
STM32 single chip microcomputer - bit band operation
C语言标准函数scanf不安全的原因
猜谜语啦(7)
Agile project management of project management
STM32 --- configuration of external interrupt
实例004:这天第几天 输入某年某月某日,判断这一天是这一年的第几天?
An enterprise information integration system
Is the security account given by Yixue school safe? Where can I open an account
319. 灯泡开关
EA introduction notes
How apaas is applied in different organizational structures
Example 010: time to show
Cinq détails de conception du régulateur de tension linéaire
Example 006: Fibonacci series