NVIDIA / NVIDIA/TensorRT

Reshape Result is Different from Onnx and TRT if Assignment is Apllied in Model

Open
#2,782 3 comments 0 reactions 1 assignee View on GitHub

@zerollzeng is already working on this.

Since Mar 19, 2023.

triaged
Dominant language
C++
Stars
13.4k
Forks
2.4k
Avg merge
5d 3h
Merged PRs (30d)
2

Description

Description

When I applied a reshape to a tensor, the result is different from the result in onnx when I assign some value to a empty tensor. To make it clear, I use torch.arange() to reproduce the bug, it seems there will be four number lost in every batch. The detail file and steps is shown below.

Environment

TensorRT Version: 8.5.1.7
NVIDIA GPU: 3090
NVIDIA Driver Version:525.60.11
CUDA Version: 12.0
CUDNN Version: 8.6.0
Operating System: ubuntu 18.04
Python Version (if applicable): 3.7.13
PyTorch Version (if applicable): 1.12.0

Relevant Files

issue.zip

Steps To Reproduce

The file is shown above, there are two .py file in it. The different between bug one and correct one is in line 21, which the bug one has an assignment, but the correct one doesn't. And the two onnx file is in it as well, bug.onnx is generated by bug_model.py and correct.onnx is generated by correct_model.py. The .py files don't rely on anything, you can just run it.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.