Skip to content
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

fix(autoware_lidar_transfusion): set tensor names by matching with predefined values. #9057

Conversation

SamratThapa120
Copy link
Contributor

@SamratThapa120 SamratThapa120 commented Oct 9, 2024

Description

When making minor architectural changes to onnx checkpoints, we found that the tensorrt IO tensor order changed, which results in the current code failing because the order of tensors is fixed in current code.

enum NetworkIO { voxels = 0, num_points, coors, cls_score, dir_pred, bbox_pred, ENUM_SIZE };

It seems that the tensor output order of the optimized tensorrt engine can be different from onnx IO order, but the tensor names match the onnx IO names. So, it is better to use the names from trt engine API to find the IO tensor positions.

We also found out that the current deployed models have faulty output names i.e the names of dir_cls_pred0 and bbox_pred0 are swapped, so they do not work with this PR. Therefore, we had to update the deployed onnx models with this PR.

Related links

Merge with autowarefoundation/autoware#5318

Parent Issue:

  • Link

How was this PR tested?

Tested using TIER IV's test rosbags locally within docker environment.
Tested using webauto evaluator. Only once test fails, because the lidar does not include intensity field in it, and transfusion requires intensity value to function properly

Notes for reviewers

None.

Interface changes

None.

@github-actions github-actions bot added component:perception Advanced sensor data processing and environment understanding. (auto-assigned) tag:require-cuda-build-and-test labels Oct 9, 2024
Copy link

github-actions bot commented Oct 9, 2024

Thank you for contributing to the Autoware project!

🚧 If your pull request is in progress, switch it to draft mode.

Please ensure:

Copy link
Contributor

@amadeuszsz amadeuszsz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for PR! Only one minor change requested.

@SamratThapa120 SamratThapa120 force-pushed the fix/transfusion/trt_output_order branch from e2a28e1 to 2dfbe77 Compare October 9, 2024 04:03
SamratThapa120 and others added 5 commits October 9, 2024 13:03
Signed-off-by: Samrat Thapa <samratthapa120@gmail.com>
Signed-off-by: Samrat Thapa <samratthapa120@gmail.com>
Signed-off-by: Samrat Thapa <samratthapa120@gmail.com>
Signed-off-by: Samrat Thapa <samratthapa120@gmail.com>
Signed-off-by: Samrat Thapa <samratthapa120@gmail.com>
@SamratThapa120 SamratThapa120 force-pushed the fix/transfusion/trt_output_order branch from 2dfbe77 to 9a3e6b7 Compare October 9, 2024 04:03
@SamratThapa120 SamratThapa120 self-assigned this Oct 9, 2024
@SamratThapa120 SamratThapa120 marked this pull request as ready for review October 9, 2024 06:22
Copy link
Contributor

@amadeuszsz amadeuszsz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Please, merge this PR with model update PR at the same time.

@SamratThapa120 SamratThapa120 added the run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label Oct 9, 2024
@SamratThapa120 SamratThapa120 merged commit 23bb4a0 into autowarefoundation:main Oct 10, 2024
38 of 40 checks passed
SamratThapa120 added a commit to tier4/autoware.universe that referenced this pull request Oct 10, 2024
…edefined values. (autowarefoundation#9057)

* set tensor order using api

Signed-off-by: Samrat Thapa <samratthapa120@gmail.com>

* style(pre-commit): autofix

Signed-off-by: Samrat Thapa <samratthapa120@gmail.com>

* fix tensor order

Signed-off-by: Samrat Thapa <samratthapa120@gmail.com>

* style(pre-commit): autofix

Signed-off-by: Samrat Thapa <samratthapa120@gmail.com>

* style fix

Signed-off-by: Samrat Thapa <samratthapa120@gmail.com>

* style(pre-commit): autofix

---------

Signed-off-by: Samrat Thapa <samratthapa120@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:perception Advanced sensor data processing and environment understanding. (auto-assigned) run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) tag:require-cuda-build-and-test
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

2 participants