fabio-sim / LightGlue-ONNX

ONNX-compatible LightGlue: Local Feature Matching at Light Speed. Supports TensorRT, OpenVINO
Apache License 2.0
376 stars 34 forks source link

onnxruntime error #21

Closed valenbase closed 1 year ago

valenbase commented 1 year ago

use the command to export the end2end model python export.py \ --img_size 512 \ --extractor_type disk \ --lightglue_path weights/superpoint_lightglue.onnx \ --end2end \ --safe and then load \ build and export the onnx model to another embedded platform then the error message occurs [ONNXRuntimeError] : 1 : FAIL : Node (/extractor/unet/2/Concat) Op (Concat) [ShapeInferenceError] Can't merge shape info. Both source and target dimension have values but they differ. Source=257 Target=256 Dimension=2

fabio-sim commented 1 year ago

Hi @valenbase , I've provided an exported end2end model in your previous issue (https://github.com/fabio-sim/LightGlue-ONNX/issues/19#issuecomment-1651650399). Could you try using that one?

I recommend exporting with python export.py --extractor_type disk --dynamic --end2end. If you provide only one number in --img_size without specifying --dynamic, the images used for tracing (image0 and image1) will be resized such that their longer side is equal to --img_size, and the exported model will be locked into whatever those input shapes are.