-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
onnx model can not be simpiflied and pass onnx.check and wierd output #10
Comments
Hi, @jinfagang
I think the values of strides are normal. The strides are based on the shape. For example, if the shape is [a,b,c,d], then the stride is [bcd, cd, d, 1].
You do not pass the onnx.checker because of the The size is still normal before the function |
@tangjiuqi097 Yes. I already have, but the issue not only had there. Onnx simplifier helps eliminate constant values and make whole graph model simple by calling onnxoptimize functions, in other words, without it, a transformer model not able to converted to any other framework, or, can not converted to by optimized way, which is meaningless. I just don't know why anchordetr can not pass simplifier while DETR can. I had tried DETR, the file size between anchordetr and detr model are almost same level, but the former can be simplified and inferenced via ONNX-runtime (after simplified). if you try inference anchordetr onnx model you will found your result will all be Nan. which means, this model can not be correctly inference via onnxruntime (even you might not gonna get any error throws). And I think even it can infer on CPU with onnxruntime, doesn't means it can inference via GPU. |
@jinfagang Hi,
This problem may be the same as issue #49 in DETR and I will fix it as they do. But I am not sure if the problem of simplifier is related to it. |
@tangjiuqi097 thanks for you notice this. Given you export onnx make nested_tensor_list out of whole trace scope, it might not highly related with that problem. But worthy to give it a try. I am still puzzeled by can not being simplified cause without it, hard to deploy on tensorrt or tvm. |
@jinfagang Now the problems are fixed by following #173 in DETR. It is because the onnx does not support the slice assignment in The problem of increased size for |
@tangjiuqi097 Nice, let me have a try. |
Hi,
It is because the
Have you loaded the checkpoint to export the onnx model? |
@jinfagang BTW, as we use the focal loss for the category loss, it should be better to use |
@tangjiuqi097 thanks for advice. |
the onnx model exported has very wierd dimension caused it can not be simplifed or pass onnx.checker.check.
This is verbose output of export DETR:
this is verbose output of AnchorDETR:
Both are last serveral layers, as you can see, for DETR the strides seems very small
but AnchorDETR are something like
Float(1, 1, 900, 91, strides=[81900, 81900, 91, 1], requires_grad=1, device=cuda:0)
gaint value.and it caused when try to check this model, or try to simplifed this model:
error got.
any idea?
The text was updated successfully, but these errors were encountered: