EVA icon indicating copy to clipboard operation
EVA copied to clipboard

About export model

Open Egorundel opened this issue 2 years ago • 8 comments

Hello, I have a question related to exporting a model. Ultimately, I'm interested in the TensorRT (.trt or .engine) format, but I'm also interested in ONNX (.onnx). Then from ONNX I will be able to make the TensorRT engine myself using trtexec from NVIDIA.

My question is, is it possible to export a trained model to ONNX?

Egorundel avatar Sep 12 '23 13:09 Egorundel

Hi, I am also interested. Have you tried ?

NVigne-cloud avatar Oct 24 '23 13:10 NVigne-cloud

@NVigne-cloud Haven't tried :(

Apparently, we will not wait for the solution of our question

Egorundel avatar Oct 24 '23 14:10 Egorundel

Currently I'm trying to convert into tensorRT. converting to ONNX seems OK but like always I think tensorRT conversion need some extra work.

SangbumChoi avatar Oct 26 '23 03:10 SangbumChoi

it seems that 2d RoPE https://github.com/baaivision/EVA/blob/b947f3fe50c50ee5370b9569efb80cd0ee2d2070/EVA-02/det/detectron2/modeling/backbone/utils.py#L309 makes trouble with following error [graphShapeAnalyzer.cpp::analyzeShapes::1872] Error Code 4: Miscellaneous (IElementWiseLayer /backbone/net/blocks.2/attn/rope_glb_1/Mul: broadcast dimensions must be conformable)

SangbumChoi avatar Oct 27 '23 13:10 SangbumChoi

any update? converting to ONNX is OK but converting to tensorRT had returned a erros: `[12/18/2023-15:05:48] [E] [TRT] [graph.cpp::symbolicExecute::611] Error Code 4: Internal Error (/ScatterND: an IScatterLayer cannot be used to compute a shape tensor) [12/18/2023-15:05:48] [E] [TRT] ModelImporter.cpp:726: While parsing node number 90 [Pad -> "/Pad_output_0"]: [12/18/2023-15:05:48] [E] [TRT] ModelImporter.cpp:727: --- Begin node --- [12/18/2023-15:05:48] [E] [TRT] ModelImporter.cpp:728: input: "/Div_output_0" input: "/Cast_2_output_0" input: "/Constant_36_output_0" output: "/Pad_output_0" name: "/Pad" op_type: "Pad" attribute { name: "mode" s: "constant" type: STRING }

[12/18/2023-15:05:48] [E] [TRT] ModelImporter.cpp:729: --- End node --- [12/18/2023-15:05:48] [E] [TRT] ModelImporter.cpp:732: ERROR: ModelImporter.cpp:185 In function parseGraph: [6] Invalid Node - /Pad [graph.cpp::symbolicExecute::611] Error Code 4: Internal Error (/ScatterND: an IScatterLayer cannot be used to compute a shape tensor) `

xinlin-xiao avatar Dec 18 '23 09:12 xinlin-xiao

is there anyone tells me how to connvert "pth" to "onnx"

woshidengweimo avatar Dec 20 '23 10:12 woshidengweimo

any update? converting to ONNX is OK but converting to tensorRT had returned a erros: `[12/18/2023-15:05:48] [E] [TRT] [graph.cpp::symbolicExecute::611] Error Code 4: Internal Error (/ScatterND: an IScatterLayer cannot be used to compute a shape tensor) [12/18/2023-15:05:48] [E] [TRT] ModelImporter.cpp:726: While parsing node number 90 [Pad -> "/Pad_output_0"]: [12/18/2023-15:05:48] [E] [TRT] ModelImporter.cpp:727: --- Begin node --- [12/18/2023-15:05:48] [E] [TRT] ModelImporter.cpp:728: input: "/Div_output_0" input: "/Cast_2_output_0" input: "/Constant_36_output_0" output: "/Pad_output_0" name: "/Pad" op_type: "Pad" attribute { name: "mode" s: "constant" type: STRING }

[12/18/2023-15:05:48] [E] [TRT] ModelImporter.cpp:729: --- End node --- [12/18/2023-15:05:48] [E] [TRT] ModelImporter.cpp:732: ERROR: ModelImporter.cpp:185 In function parseGraph: [6] Invalid Node - /Pad [graph.cpp::symbolicExecute::611] Error Code 4: Internal Error (/ScatterND: an IScatterLayer cannot be used to compute a shape tensor) `

hello, I meet the same error, have you solved it?

LordonCN avatar Jan 04 '24 03:01 LordonCN

Just pip install onnxslim==0.1.9.1 And

OnnxSlim-main# onnxslim model-input-no-mask.onnx slimmed_model-input-no-mask.onnx optimization --skip_fusion_patterns FusionGelu  can being solved it but onnx2trt will return a new errors,I can not solved the new errors

---Original--- From: @.> Date: Thu, Jan 4, 2024 11:32 AM To: @.>; Cc: @.@.>; Subject: Re: [baaivision/EVA] About export model (Issue #117)

any update? converting to ONNX is OK but converting to tensorRT had returned a erros: `[12/18/2023-15:05:48] [E] [TRT] [graph.cpp::symbolicExecute::611] Error Code 4: Internal Error (/ScatterND: an IScatterLayer cannot be used to compute a shape tensor) [12/18/2023-15:05:48] [E] [TRT] ModelImporter.cpp:726: While parsing node number 90 [Pad -> "/Pad_output_0"]: [12/18/2023-15:05:48] [E] [TRT] ModelImporter.cpp:727: --- Begin node --- [12/18/2023-15:05:48] [E] [TRT] ModelImporter.cpp:728: input: "/Div_output_0" input: "/Cast_2_output_0" input: "/Constant_36_output_0" output: "/Pad_output_0" name: "/Pad" op_type: "Pad" attribute { name: "mode" s: "constant" type: STRING }

[12/18/2023-15:05:48] [E] [TRT] ModelImporter.cpp:729: --- End node --- [12/18/2023-15:05:48] [E] [TRT] ModelImporter.cpp:732: ERROR: ModelImporter.cpp:185 In function parseGraph: [6] Invalid Node - /Pad [graph.cpp::symbolicExecute::611] Error Code 4: Internal Error (/ScatterND: an IScatterLayer cannot be used to compute a shape tensor) `

hello, I meet the same error, have you solved it?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

xinlin-xiao avatar Jan 04 '24 04:01 xinlin-xiao