Hello,
I am trying to convert Mobile_SAM onnx model to tensorrt. I am facing the following error.
[08/07/2023-17:58:33] [I] [TRT] [MemUsageChange] TensorRT-managed allocation in IExecutionContext creation: CPU +0, GPU +45, now: CPU 0, GPU 60 (MiB)
[08/07/2023-17:58:33] [W] [TRT] CUDA lazy loading is not enabled. Enabling it can significantly reduce device memory usage and speed up TensorRT initialization. See “Lazy Loading” section of CUDA documentation CUDA C++ Programming Guide
[08/07/2023-17:58:33] [I] Setting persistentCacheLimit to 0 bytes.
[08/07/2023-17:58:33] [I] Using values loaded from /content/image_embeddings_1.bin for input image_embeddings
[08/07/2023-17:58:33] [I] Input binding for image_embeddings with dimensions 1x256x64x64 is created.
[08/07/2023-17:58:33] [I] Using values loaded from /content/points_coords_1.bin for input point_coords
[08/07/2023-17:58:33] [E] Uncaught exception detected: Cannot open file /content/points_coords_1.bin!
I have verified the file. It works fine and there are other binary files which are working fine but I dont understand why I am getting this error.Below is the command line execution:
Hi,
Request you to share the ONNX model and the script if not shared already so that we can assist you better.
Alongside you can try few things:
validating your model with the below snippet
check_model.py
import sys
import onnx
filename = yourONNXmodel
model = onnx.load(filename)
onnx.checker.check_model(model).
2) Try running your model with trtexec command.
In case you are still facing issue, request you to share the trtexec “”–verbose"" log for further debugging
Thanks!
Hi! Sure,Thank you for the reply. Below are the attached files (onnx and binary files). I have just executed the trtexec line mentioned in the previous comment.
[08/10/2023-15:51:09] [I] [TRT] [MS] The main stream provided by execute/enqueue calls is the first worker stream
[08/10/2023-15:51:09] [I] [TRT] [MemUsageChange] TensorRT-managed allocation in IExecutionContext creation: CPU +0, GPU +45, now: CPU 0, GPU 60 (MiB)
[08/10/2023-15:51:09] [W] [TRT] CUDA lazy loading is not enabled. Enabling it can significantly reduce device memory usage and speed up TensorRT initialization. See "Lazy Loading" section of CUDA documentation https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#lazy-loading
[08/10/2023-15:51:09] [I] Setting persistentCacheLimit to 0 bytes.
[08/10/2023-15:51:09] [E] Cannot find input tensor with name "‘has_mask_input’" in the engine bindings! Please make sure the input tensor names are correct.
[08/10/2023-15:51:09] [E] Invalid tensor names found in --loadInputs flag.
[08/10/2023-15:51:09] [E] Inference set up failed
&&&& FAILED TensorRT.trtexec [TensorRT v8601] # trtexec --onnx=sam_onnx_example_without_quantization.onnx --loadInputs=‘image_embeddings’:./image_embeddings_1.bin,‘point_coords’:./points_coords_1.bin,‘point_labels’:./point_labels_1.bin,‘mask_input’:./mask_input_1.bin,‘has_mask_input’:./has_mask_input_1.bin,‘orig_im_size’:./orig_im_size_1.bin --shapes=image_embeddings:1x256x64x64,point_coords:1x5x2,point_labels:1x5,mask_input:1x1x256x256,has_mask_input:1,orig_im_size:1x2