-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Error Code 4: Miscellaneous (IShuffleLayer Reshape_427: reshape changes volume. Reshaping [900,1,256] to [900,7200,32].) #2245
Comments
Usually, this happened when your model has a dynamic input shape and a fixed reshape operation, can you check it first? |
I got this same error. What do you want me to check? @zerollzeng |
Check the onnx model first, e.g. run it with onnx runtime with a preset input shapes. |
the problem here is simple, support you have a reshape layer, reshape a tensor to 2x6, it's has an input of axb, then axb must equal to 2x6=12 |
Yeah- I made another issue explaining my issue more closely, but I knew what you meant before already. Ill check it later with onnxruntime |
I've found out the reason which is related to the layer norm. In my model, the input of LN is a tensor of [900,1,256], the LN function is called by |
I've fixed the shape error but got another new problem. the outputs of onnx and trtfp32 engine are quite different after the torch.bmm operator in cross attention module. |
I'm working with Detectron2 so its impossible for me to realistically edit the source code. |
Can you provide a reproduce so that I can check it on my side? I would prefer a minimal onnx model. |
https://drive.google.com/drive/folders/13LGb4uCEzrLV4k1dRa9FBHPnrrAwXfSf?usp=sharing |
I can't reproduce it using polygraphy, all output is matched:
|
@zerollzeng does constant folding make the model better/faster? |
|
Are you using the real data for input? it might be caused by your input data, e.g. if you feed random binary data to it, it might be large value like e+6 |
closing since no activity for more than 3 weeks, please reopen if you still have question, thanks! |
Use NGC pytorch:22.12-py3 instead of pytorch:22.07-py3 to fix “Error Code 4: Miscellaneous (IShuffleLayer Reshape_179: reshape changes volume. Reshaping [784] to [1])" |
I also come across this problem
the onnx's input all are fixed shape, but inner network has data-dependent op like nonzero, if I replace all code related to data-dependent operations with plugins for implementation, the errors will not occur. |
hello, when i coverted my onnx model to TensorRT by the command,
![error](https://user-images.githubusercontent.com/56212446/184589569-84f0c06e-a000-43d9-b335-138787f4f7f1.png)
./trtexec --onnx=model.onnx --saveEngine=model.engine
i got big diff between pytorch result and trt result. i located the problem which might be related to the decoder transformer part of my model. so i only coverted the transformer part to onnx and try to find out what is wrong. but when i run the command
./trtexec --onnx=decoder_transformer.onnx --saveEngine=decoder_transformer.engine
to covert onnx to trt. i got an error which didn't appear during the "model.onnx" converting.The error comes from the cross attention part. but the error disappears when i only covert the cross attention module to onnx and trt by
./trtexec --onnx=cross_attention.onnx --saveEngine=cross_attention.engine
. so finally i can not figure out how to solve the problem to get correct trt result and open a issue for some help. Thanks~Environment
TensorRT Version: 8.4.1.5+cuda11.6
NVIDIA GPU: A100
NVIDIA Driver Version: 510.47.03
CUDA Version: 11.6
CUDNN Version: 8.4.0.27
Operating System: Ubuntu 20.04.2 LTS
Python Version: 3.7.13
PyTorch Version: 1.10
The text was updated successfully, but these errors were encountered: