当前位置:网站首页>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
边栏推荐
- STM32 --- serial port communication
- [three tier architecture]
- 猜谜语啦(142)
- Daily question - input a date and output the day of the year
- 剑指 Offer 05. 替换空格
- TypeScript手把手教程,简单易懂
- 实例009:暂停一秒输出
- Illustration of eight classic pointer written test questions
- Example 002: the bonus paid by the "individual income tax calculation" enterprise is based on the profit commission. When the profit (I) is less than or equal to 100000 yuan, the bonus can be increase
- 99 multiplication table (C language)
猜你喜欢
Example 002: the bonus paid by the "individual income tax calculation" enterprise is based on the profit commission. When the profit (I) is less than or equal to 100000 yuan, the bonus can be increase
实例009:暂停一秒输出
如何写Cover Letter?
Business modeling of software model | overview
[three tier architecture and JDBC summary]
猜谜语啦(3)
STM32 summary (HAL Library) - DHT11 temperature sensor (intelligent safety assisted driving system)
Example 003: a complete square is an integer. It is a complete square after adding 100, and it is a complete square after adding 168. What is the number?
Detailed summary of FIO test hard disk performance parameters and examples (with source code)
STM32 single chip microcomputer - external interrupt
随机推荐
UE像素流,来颗“减肥药”吧!
Illustration of eight classic pointer written test questions
Typescript hands-on tutorial, easy to understand
How to manage the performance of R & D team?
Basic number theory - factors
剑指 Offer 06. 从尾到头打印链表
【NOI模拟赛】汁树(树形DP)
Warning: retrying occurs during PIP installation
Bluebridge cup internet of things competition basic graphic tutorial - clock selection
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?
实例001:数字组合 有四个数字:1、2、3、4,能组成多少个互不相同且无重复数字的三位数?各是多少?
Guess riddles (8)
Array integration initialization (C language)
99 multiplication table (C language)
实例004:这天第几天 输入某年某月某日,判断这一天是这一年的第几天?
实例002:“个税计算” 企业发放的奖金根据利润提成。利润(I)低于或等于10万元时,奖金可提10%;利润高于10万元,低于20万元时,低于10万元的部分按10%提成,高于10万元的部分,可提成7.
Business modeling of software model | vision
[formation quotidienne - Tencent Selection 50] 557. Inverser le mot III dans la chaîne
[daily training] 1200 Minimum absolute difference
Business modeling of software model | stakeholders