Skip to content

🐛 [Bug] Encountered bug when compiling fasterrcnn_mobilenet_v3_large_320_fpn in Dynamo #1995

Closed
@gs-olive

Description

@gs-olive

Bug Description

When compiling the fasterrcnn_mobilenet_v3_large_320_fpn with torch_tensorrt.dynamo.compile, the following error is encountered:

[06/07/2023-16:56:55] [TRT] [W] IElementWiseLayer with inputs (Unnamed Layer* 7) [Shuffle]_output and (Unnamed Layer* 6) [Shuffle]_output: first input has type Int32 but second input has type Float.
[06/07/2023-16:56:55] [TRT] [W] IElementWiseLayer with inputs (Unnamed Layer* 8) [Shuffle]_output and (Unnamed Layer* 0) [Shuffle]_output: first input has type Int32 but second input has type Float.
[06/07/2023-16:56:55] [TRT] [W] IElementWiseLayer with inputs (Unnamed Layer* 9) [Shuffle]_output and (Unnamed Layer* 4) [Shuffle]_output: first input has type Int32 but second input has type Float.
[06/07/2023-16:56:55] [TRT] [E] 4: [elementWiseLayer.cpp::validate::36] Error Code 4: Internal Error ([ELEMENTWISE]-[unknown_ir_ops.add.Tensor]-[add]: operation SUM has incompatible input types Int32 and Float)
[06/07/2023-16:56:55] [TRT] [E] 4: [elementWiseLayer.cpp::validate::36] Error Code 4: Internal Error ([ELEMENTWISE]-[unknown_ir_ops.add.Tensor]-[add_2]: operation SUM has incompatible input types Int32 and Float)
INFO:torch_tensorrt.fx.fx2trt:TRT INetwork construction elapsed time: 0:00:00.099711
[06/07/2023-16:56:55] [TRT] [E] 4: [graphShapeAnalyzer.cpp::needTypeAndDimensions::2212] Error Code 4: Internal Error ([ELEMENTWISE]-[unknown_ir_ops.add.Tensor]-[add]: output shape can not be computed)
[06/07/2023-16:56:55] [TRT] [E] 4: [elementWiseLayer.cpp::validate::36] Error Code 4: Internal Error ([ELEMENTWISE]-[unknown_ir_ops.add.Tensor]-[add]: operation SUM has incompatible input types Int32 and Float)

To Reproduce

Steps to reproduce the behavior:

model = torchvision.models.detection.fasterrcnn_mobilenet_v3_large_320_fpn().eval().cuda()
inp = torch.rand((3, 300, 400)).cuda()
inp2 = torch.rand((3, 500, 400)).cuda()
model_acc = torch_tensorrt.dynamo.compile(model, [inp, inp2], pass_through_build_failures=True)

Expected behavior

Model should compile without errors.

Environment

  • Torch-TensorRT Version (e.g. 1.0.0): 075a028
  • PyTorch Version (e.g. 1.0): 2.1.0.dev20230606+cu118

Additional context

Related: #1565

Metadata

Metadata

Assignees

Labels

No ActivitybugSomething isn't workingcomponent: dynamoIssues relating to the `torch.compile` or `torch._dynamo.export` paths

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions