NVIDIA / NVIDIA/TensorRT

“Error Code 2: Internal Error (Assertion y->type() == signature.operandType(1) failed.” failure of TensorRT 8.5.2 when running sam_decoder.onnx on GPU RTX 3060

Open
#2,968 22 comments 0 reactions 1 assignee View on GitHub

@zerollzeng is already working on this.

Since May 16, 2023.

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

Description

Description

I tried to transfer onnx file of sam to tensorRT for deployment, but it fails with the error below .

"""
[2023-05-15 15:36:25][info][trt_builder.cpp:474]:Compile FP32 Onnx Model 'D:/xiaowen/python/logs/sam/sam_vit_b_encoder.onnx'.
[2023-05-15 15:36:35][warn][trt_builder.cpp:33]:NVInfer: CUDA lazy loading is not enabled. Enabling it can significantly reduce device memory usage. See CUDA_MODULE_LOADING in https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#env-vars
[2023-05-15 15:36:36][error][trt_builder.cpp:30]:NVInfer: TensorRT\onnx_parser\ModelImporter.cpp:736: While parsing node number 297 [Mod -> "onnx::Sub_211"]:
[2023-05-15 15:36:36][error][trt_builder.cpp:30]:NVInfer: TensorRT\onnx_parser\ModelImporter.cpp:737: --- Begin node ---
[2023-05-15 15:36:36][error][trt_builder.cpp:30]:NVInfer: TensorRT\onnx_parser\ModelImporter.cpp:738: input: "onnx::Mod_203"
input: "onnx::Mod_210"
output: "onnx::Sub_211"
name: "Mod_297"
op_type: "Mod"
attribute {
name: "fmod"
i: 0
type: INT
}

[2023-05-15 15:36:36][error][trt_builder.cpp:30]:NVInfer: TensorRT\onnx_parser\ModelImporter.cpp:739: --- End node ---
[2023-05-15 15:36:36][error][trt_builder.cpp:30]:NVInfer: TensorRT\onnx_parser\ModelImporter.cpp:742: ERROR: TensorRT\onnx_parser\builtin_op_importers.cpp:4742 In function importFallbackPluginImporter:
[8] Assertion failed: creator && "Plugin not found, are the plugin name, version, and namespace correct?"
[2023-05-15 15:36:36][error][trt_builder.cpp:519]:Can not parse OnnX file: D:/xiaowen/python/logs/sam/sam_vit_b_encoder.onnx
[2023-05-15 15:36:36][info][direct_sam.cpp:40]:Compile done
[2023-05-15 15:36:36][info][trt_builder.cpp:474]:Compile FP32 Onnx Model 'D:/xiaowen/python/logs/sam/sam_vit_b_decoder.onnx'.
[2023-05-15 15:36:38][warn][trt_builder.cpp:33]:NVInfer: CUDA lazy loading is not enabled. Enabling it can significantly reduce device memory usage. See CUDA_MODULE_LOADING in https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#env-vars
[2023-05-15 15:36:40][error][trt_builder.cpp:30]:NVInfer: TensorRT\onnx_parser\ModelImporter.cpp:534: Found unsupported shape-tensor producing layer:Reciprocal_1095
[2023-05-15 15:36:40][warn][trt_builder.cpp:33]:NVInfer: Tensor DataType is determined at build time for tensors not marked as input or output.
[2023-05-15 15:36:40][warn][trt_builder.cpp:33]:NVInfer: Tensor DataType is determined at build time for tensors not marked as input or output.
[2023-05-15 15:36:40][error][trt_builder.cpp:30]:NVInfer: TensorRT\onnx_parser\ModelImporter.cpp:534: Found unsupported shape-tensor producing layer:Floor_1101
[2023-05-15 15:36:40][info][trt_builder.cpp:558]:Input shape is -1 x 256 x 64 x 64
[2023-05-15 15:36:40][info][trt_builder.cpp:559]:Set max batch size = 1
[2023-05-15 15:36:40][info][trt_builder.cpp:560]:Set max workspace size = 3072.00 MB
[2023-05-15 15:36:40][info][trt_builder.cpp:561]:Base device: [ID 0]<NVIDIA GeForce RTX 3060>[arch 8.6][GMEM 10.75 GB/12.00 GB]
[2023-05-15 15:36:40][info][trt_builder.cpp:564]:Network has 6 inputs:
[2023-05-15 15:36:40][info][trt_builder.cpp:570]: 0.[image_embeddings] shape is -1 x 256 x 64 x 64
[2023-05-15 15:36:40][info][trt_builder.cpp:570]: 1.[point_coords] shape is -1 x -1 x 2
[2023-05-15 15:36:40][info][trt_builder.cpp:570]: 2.[point_labels] shape is -1 x -1
[2023-05-15 15:36:40][info][trt_builder.cpp:570]: 3.[mask_input] shape is -1 x 1 x 256 x 256
[2023-05-15 15:36:40][info][trt_builder.cpp:570]: 4.[has_mask_input] shape is -1
[2023-05-15 15:36:40][info][trt_builder.cpp:570]: 5.[orig_im_size] shape is -1
[2023-05-15 15:36:40][info][trt_builder.cpp:576]:Network has 3 outputs:
[2023-05-15 15:36:41][error][trt_builder.cpp:30]:NVInfer: 2: [shapeContext.cpp::nvinfer1::builder::ShapeContext::op::1661] Error Code 2: Internal Error (Assertion y->type() == signature.operandType(1) failed. )
"""

Environment

TensorRT Version:
8.5.2.2

NVIDIA GPU:
RTX 3060

NVIDIA Driver Version:
Driver Version: 517.02

CUDA Version:
CUDA Version: 11.7

CUDNN Version:
8.6

Have you tried the latest release?:
no

Can this model run on other frameworks? For example run ONNX model with ONNXRuntime (polygraphy run <model.onnx> --onnxrt):
yes, run with onnxruntime is perfect.

### Tasks

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.