Closed ghost closed 3 months ago
@piotrwierzba-tplx Thanks for reporting. It IS a problem that the current version cannot handle well. I am thinking about how to fix it. Could you try to add some ONNX operators that can modify the input / output shape, such as Reshape
and Transpose
?
reporting @ZhangGe6
Hello, there are some questions in op reshape. I add the op before output that want to shape it from [1, 5, 640, 640] to [1,5,409600],but it failed, can you help me to solve this problem? wait for your reply.
@KONGYOUYL Hi, Sorry for the late response. Can you explain the failure with more info? It is suggested to share the error log in the console. Thanks.
@ZhangGe6 I'm facing a similar issue. The error I get is:
[04/16/2024-15:39:02] [E] [TRT] ModelImporter.cpp:771: While parsing node number 40 [Reshape -> "layer3_outconv_reshaped"]:
[04/16/2024-15:39:02] [E] [TRT] ModelImporter.cpp:772: --- Begin node ---
[04/16/2024-15:39:02] [E] [TRT] ModelImporter.cpp:773: input: "layer3_outconv_transp"
input: "2,4096,256"
output: "layer3_outconv_reshaped"
name: "custom_added_Reshape0"
op_type: "Reshape"
[04/16/2024-15:39:02] [E] [TRT] ModelImporter.cpp:774: --- End node ---
[04/16/2024-15:39:02] [E] [TRT] ModelImporter.cpp:777: ERROR: ModelImporter.cpp:150 In function parseGraph:
[5] Assertion failed: (ctx->tensors().count(inputName)) && "Node input was not registered."
[04/16/2024-15:39:02] [E] Failed to parse onnx file
Editing input shape is supported in this commit. The Output sizes are not supposed to be changed manually and should rely on the result of shape inference. Please try the shape inference feature.
While editing ONNX, one might remove nodes between output / input, which in turn affect the input / output shapes. Unfortunately, the input and output shapes cannot be modified in the editor. Checking the net using the following command:
Yields various errors, depending whether the input or the output have wrong shapes. Please add a way to either strip or modify the input / output shapes, as saving the modified network will not result in a correct model that can be used.