spacewalk01 / depth-anything-tensorrt

TensorRT implementation of Depth-Anything V1, V2
https://depth-anything.github.io/
MIT License
227 stars 28 forks source link

[E] Error[4]: If_1249_OutputLayer: IIfConditionalOutputLayer inputs must have the same shape. #8

Closed dijiupianhai9 closed 5 months ago

dijiupianhai9 commented 5 months ago

01/30/2024-18:29:22] [E] Error[4]: If_1249_OutputLayer: IIfConditionalOutputLayer inputs must have the same shape. [01/30/2024-18:29:22] [E] [TRT] ModelImporter.cpp:773: While parsing node number 1249 [If -> "output"]: [01/30/2024-18:29:22] [E] [TRT] ModelImporter.cpp:774: --- Begin node --- [01/30/2024-18:29:22] [E] [TRT] ModelImporter.cpp:775: input: "1593" output: "output" name: "If_1249" op_type: "If" attribute { name: "then_branch" g { node { input: "1588" output: "1595" name: "Squeeze_1250" op_type: "Squeeze" attribute { name: "axes" ints: 1 type: INTS } } name: "torch-jit-export1" output { name: "1595" type { tensor_type { elem_type: 1 shape { dim { dim_param: "Squeeze1595_dim_0" } dim { dim_param: "Squeeze1595_dim_1" } dim { dim_param: "Squeeze1595_dim_2" } } } } } } type: GRAPH } attribute { name: "else_branch" g { node { input: "1588" output: "1596" name: "Identity_1251" op_type: "Identity" } name: "torch-jit-export2" output { name: "1596" type { tensor_type { elem_type: 1 shape { dim { dim_param: "Squeeze1595_dim_0" } dim { dim_param: "Identity1596_dim_1" } dim { dim_param: "Squeeze1595_dim_1" } dim { dim_param: "Squeeze1595_dim_2" } } } } } } type: GRAPH }

[01/30/2024-18:29:22] [E] [TRT] ModelImporter.cpp:776: --- End node --- [01/30/2024-18:29:22] [E] [TRT] ModelImporter.cpp:779: ERROR: ModelImporter.cpp:180 In function parseGraph: [6] Invalid Node - If_1249 If_1249_OutputLayer: IIfConditionalOutputLayer inputs must have the same shape. [01/30/2024-18:29:22] [E] Failed to parse onnx file [01/30/2024-18:29:22] [I] Finish parsing network model [01/30/2024-18:29:22] [E] Parsing model failed [01/30/2024-18:29:22] [E] Failed to create engine from model or file. [01/30/2024-18:29:22] [E] Engine set up failed

The above error was reported when using onnx model to export to tensorrt engine model. Have you ever encountered it?

spacewalk01 commented 5 months ago

Yes i had the same problem. I fixed it by removing squeeze operation in dpt.py. Copy and paste dpt.py in this repo to /depth_anything folder.

dijiupianhai9 commented 5 months ago

Thank you for your reply, I have solved the problem. Now I have a new question. Do you have any ideas?

LLVM ERROR: out of memory Aborted (core dumped)

spacewalk01 commented 5 months ago

I didn't use llvm. Where did you get this error?

lbq779660843 commented 5 months ago

You may compile on a machine of one architecture but copy all the files to run on a machine of another architecture. You can try just to remove the build folder or reclone the whole repository and then rebuild it. If it doesn't work you should consider checking out the configuration of environment variables.

dijiupianhai9 commented 5 months ago

Thanks, I solved the problem, I did not infer the image it can be used normally, maybe there is a problem with my internal library.