-
Notifications
You must be signed in to change notification settings - Fork 517
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
YOLO-NAS generate float64 constants after export to ONNX #1392
Labels
Comments
Thanks for your bugreport @tomwang221812 |
BloodAxe
added a commit
that referenced
this issue
Aug 24, 2023
…constants in ONNX file is fp32 and not fp64. #1392
BloodAxe
added a commit
that referenced
this issue
Aug 24, 2023
* Fix wrong type annotation for quantization_mode * Fix initialization of example_input_image * Added provides to stay compatible with newer onnxruntime that require provides to be present * Fixed edge case of exporting detection models of small size and num_pre_nms_predictions that exceeds this value * Change initilization of grid in yolox/yolonas/ppyoloe to ensure that constants in ONNX file is fp32 and not fp64. #1392
Hi, The shift_x = torch.arange(end=w, dtype=dtype, device=device) + self.grid_cell_offset
... Thanks. |
The PR with a fix was already merged and will be released as 3.2.1 probably this week. |
Fixed in 3.2.1 |
BloodAxe
added
YoloNAS
Fixed-In-3.2.1
Fixed in 3.2.1 release
and removed
Planned
The fix is on the roadmap
TODO
Probably should be done, but not planned yet
labels
Sep 7, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
🐛 Describe the bug
Hi,
Export Code:
I found that the exported onnx model will create some
Expand
OPs with data typefloat64
and maybe we don't need to cast the data tofloat32
beforeConcat
iftorch.meshgrid
takes the same data type as input tensor?The related code is in:
super-gradients/src/super_gradients/training/models/detection_models/yolo_nas/dfl_heads.py
Lines 284 to 291 in 6f0a66f
After some experiment I found that the data type casting must be earlier than
torch.meshgrid
to resolve this issue.After that the
Expand
OP data type should be float32:I think most of the time this is not an issue but some compiler of AI accelerator seems lack of float64 data type support that makes the compiler stop compiling.
Versions
Docker image: nvcr.io/nvidia/pytorch:23.07-py3
The text was updated successfully, but these errors were encountered: