question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

onnx converted to trt problem

See original GitHub issue

when i converted onnx model to trt, always getting a reshape error, error are as follows: 10_27_16_38_[TRT: ERR][graphShapeAnalyzer.cpp::nvinfer1::builder::`anonymous-namespace’::ShapeNodeRemover::analyzeShapes::1285] Error Code 4: Miscellaneous (IShuffleLayer Reshape_170: reshape changes volume. Reshaping [14763] to [1].) 10_27_16_38_[TRT: ERR]ModelImporter.cpp:773: While parsing node number 170 [Reshape -> “489”]: 10_27_16_38_[TRT: ERR]ModelImporter.cpp:774: — Begin node — 10_27_16_38_[TRT: ERR]ModelImporter.cpp:775: input: “487” input: “488” output: “489” name: “Reshape_170” op_type: “Reshape”

10_27_16_38_[TRT: ERR]ModelImporter.cpp:776: — End node — 10_27_16_38_[TRT: ERR]ModelImporter.cpp:779: ERROR: ModelImporter.cpp:179 In function parseGraph: [6] Invalid Node - Reshape_170 [graphShapeAnalyzer.cpp::nvinfer1::builder::`anonymous-namespace’::ShapeNodeRemover::analyzeShapes::1285] Error Code 4: Miscellaneous (IShuffleLayer Reshape_170: reshape changes volume. Reshaping [14763] to [1].)

when i remove anomaly_score item in output ,such as: anomaly_map = self.anomaly_map_generator(patch_scores) output = (anomaly_map)

and the error changed, 10_27_15_11_[TRT: ERR][shuffleNode.cpp::nvinfer1::builder::ShuffleNode::symbolicExecute::387] Error Code 4: Internal Error (Reshape_183: IShuffleLayer applied to shape tensor must have 0 or 1 reshape dimensions: dimensions were [-1,2]) 10_27_15_11_[TRT: ERR]ModelImporter.cpp:773: While parsing node number 193 [Pad -> “521”]: 10_27_15_11_[TRT: ERR]ModelImporter.cpp:774: — Begin node — 10_27_15_11_[TRT: ERR]ModelImporter.cpp:775: input: “486” input: “520” output: “521” name: “Pad_193” op_type: “Pad” attribute { name: “mode” s: “reflect” type: STRING }

10_27_15_11_[TRT: ERR]ModelImporter.cpp:776: — End node — 10_27_15_11_[TRT: ERR]ModelImporter.cpp:779: ERROR: ModelImporter.cpp:179 In function parseGraph: [6] Invalid Node - Pad_193 [shuffleNode.cpp::nvinfer1::builder::ShuffleNode::symbolicExecute::387] Error Code 4: Internal Error (Reshape_183: IShuffleLayer applied to shape tensor must have 0 or 1 reshape dimensions: dimensions were [-1,2])

finally, i find it’s problem always appear inBelow the ConstantOfShape node。

what should i do, for this problem?

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
Leonardo0325commented, Nov 12, 2022

,I found and solved this problem, It is a problem due to padding operation, replace this operation.

Hi,Can you explain how to solve this problem,Please show the code, thank you!

1reaction
samet-akcaycommented, Nov 7, 2022

@montensorrt, for a future reference, can you elaborate how exactly you fixed the problem? It could be useful for other users. We might also potentially create a PR to fix it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

have problem for converting ONNX model to TRT · Issue #2225
Description Hi, I wanna convert my ONNX model to TRT. I use the below command to convert this model: /usr/src/tensorrt/bin/trtexec --onnx=model_folded.onnx ...
Read more >
Input length mismatch (onnx conversion to .trt) - TensorRT
I have an .onnx model which I would like to convert to a .trt engine. In the beginning I got an error similar...
Read more >
Tutorial 9: ONNX to TensorRT (Experimental)
Try the new MMDeploy to deploy your model. Tutorial 9: ONNX to TensorRT (Experimental). How to convert models from ONNX to TensorRT. Prerequisite....
Read more >
Centernet model TensortRT file type conversion - Stack Overflow
onnx model, when I converted to TensorRT engine with trtexec (.trt), I am getting error. This error relevant with datatype, so I changed...
Read more >
Face recognition: OnnX to TensorRT conversion of Arcface ...
Now let's convert the downloaded ONNX model into TensorRT arcface_trt.engine. ... If this command gives an error, then ONNX is not installed on...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found