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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悰 [Bug] Incomplete upsample implementation in dynamo converter #2680

Open
HolyWu opened this issue Mar 9, 2024 · 0 comments 路 May be fixed by #2790
Open

馃悰 [Bug] Incomplete upsample implementation in dynamo converter #2680

HolyWu opened this issue Mar 9, 2024 · 0 comments 路 May be fixed by #2790
Assignees
Labels
bug Something isn't working

Comments

@HolyWu
Copy link
Contributor

HolyWu commented Mar 9, 2024

  1. The Resize layer supports NEAREST, LINEAR, CUBIC resize modes, but only NEAREST and LINEAR are implemented.
    if resize_mode == "nearest" or None:
    resize_layer.resize_mode = trt.ResizeMode.NEAREST
    elif resize_mode == "bilinear":
    resize_layer.resize_mode = trt.ResizeMode.LINEAR
    if align_corners is None or not align_corners:
    raise RuntimeError(
    f"Interpolation works differently is align_corners is False for {resize_mode} mode in PyTorch and TensorRT."
    )
    else:
    raise RuntimeError(
    f"Interpolation mode is {resize_mode} which is not supported by TensorRT."
    )
  2. The LINEAR resize mode supports linear (1D), bilinear (2D), trilinear (3D) interpolations, but only bilinear is accepted in dynamo.
  3. An error is thrown saying Interpolation works differently if align_corners is False for bilinear mode in PyTorch and TensorRT. when resize_mode == "bilinear" and align_corners is False. That is quite wrong because the coordinate_transformation is incorrectly set to ASYMMETRIC when align_corners=False.
    elif resize_mode == "bilinear":
    # align corners
    if align_corners is not None and align_corners:
    resize_layer.coordinate_transformation = (
    trt.ResizeCoordinateTransformation.ALIGN_CORNERS
    )
    else:
    resize_layer.coordinate_transformation = (
    trt.ResizeCoordinateTransformation.ASYMMETRIC
    )
@HolyWu HolyWu added the bug Something isn't working label Mar 9, 2024
@zewenli98 zewenli98 assigned bowang007 and unassigned zewenli98 Mar 12, 2024
@HolyWu HolyWu linked a pull request Apr 27, 2024 that will close this issue
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants