-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
SAM-vit_b-prompt model build engine failed of TensorRT 8.6.12 when using dynamic shape of num_point #3536
Comments
As it said: OneHot: Onehot layer cannot be used to compute a shape tensor. It's a known limitation. Could you please try constant folding? |
I using constant_folding in torch-onnx export in front code ,but ... `
` |
Okay, looks like this need to fixed in Torch source code... |
Or it just simply a TRT limitation. |
closing since no activity for more than 3 weeks, pls reopen if you still have question, thanks! |
does it work? do_constant_folding=True, |
Description
Environment
TensorRT Version: 8.6.12
NVIDIA GPU:
NVIDIA Driver Version:
CUDA Version:
CUDNN Version:
Operating System:
Python Version (if applicable): 3.9
Tensorflow Version (if applicable):
PyTorch Version (if applicable):
Baremetal or Container (if so, version):
Relevant Files
Model link:
Steps To Reproduce
git clone https://github.com/facebookresearch/segment-anything
export prompt_mask
`def export_prompt_masks_model(model_type: str, checkpoint: str, opset: 17):
print("Loading model...")
sam = sam_model_registry“vit_b”
trtexec import trt engine
trtexec --onnx=sam_vit_b_dy.onnx --saveEngine=sam_vit_b_prompt_mask_format_dynamic.engine --minShapes=point_coords:1x1x2,point_labels:1x1 --optShapes=point_coords:1x1x2,point_labels:1x1 --maxShapes=point_coords:1x10x2,point_labels:1x10
found
Commands or scripts:
Have you tried the latest release?:
Can this model run on other frameworks? For example run ONNX model with ONNXRuntime (
polygraphy run <model.onnx> --onnxrt
):The text was updated successfully, but these errors were encountered: