NVIDIA-AI-IOT / nanosam

A distilled Segment Anything (SAM) model capable of running real-time with NVIDIA TensorRT
Apache License 2.0
632 stars 55 forks source link

Compiled against cuBLASLt 11.10.3.0 but running against cuBLASLt 11.5.1.0. help me please.. #17

Open countlesswu opened 9 months ago

countlesswu commented 9 months ago

Namespace(image_encoder='/data/wl/code/nanosam/data/resnet18_image_encoder.engine', mask_decoder='/data/wl/code/nanosam/data/mobile_sam_mask_decoder.engine') [01/02/2024-19:26:41] [TRT] [E] 1: [raiiMyelinGraph.h::RAIIMyelinGraph::24] Error Code 1: Myelin (Compiled against cuBLASLt 11.10.3.0 but running against cuBLASLt 11.5.1.0.) /data/wl/code/nanosam/nanosam/utils/predictor.py:84: UserWarning: The given NumPy array is not writable, and PyTorch does not support non-writable tensors. This means writing to this tensor will result in undefined behavior. You may want to copy the array to protect its data or make it writable before converting it to a tensor. This type of warning will be suppressed for the rest of this program. (Triggered internally at /opt/conda/conda-bld/pytorch_1656352660876/work/torch/csrc/utils/tensor_numpy.cpp:172.) image_torch_resized = torch.from_numpy(image_np_resized).permute(2, 0, 1) <tensorrt.tensorrt.IExecutionContext object at 0x7f64a2078ab0> /data/wl/code/nanosam/nanosam/utils/predictor.py:103: UserWarning: Creating a tensor from a list of numpy.ndarrays is extremely slow. Please consider converting the list to a single numpy.ndarray with numpy.array() before converting to a tensor. (Triggered internally at /opt/conda/conda-bld/pytorch_1656352660876/work/torch/csrc/utils/tensor_new.cpp:201.) image_point_coords = torch.tensor([points]).float().cuda() None Traceback (most recent call last): File "/data/wl/code/nanosam/examples/basicusage.py", line 51, in mask, , _ = predictor.predict(points, point_labels) File "/data/wl/code/nanosam/nanosam/utils/predictor.py", line 164, in predict mask_iou, low_res_mask = run_mask_decoder( File "/data/wl/code/nanosam/nanosam/utils/predictor.py", line 113, in run_mask_decoder iou_predictions, low_res_masks = mask_decoder_engine( File "/home/lab-10/miniconda3/envs/nanosam/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1130, in _call_impl return forward_call(*input, **kwargs) File "/home/lab-10/miniconda3/envs/nanosam/lib/python3.9/site-packages/torch2trt-0.4.0-py3.9.egg/torch2trt/torch2trt.py", line 618, in forward self.context.set_binding_shape(idx, shape) AttributeError: 'NoneType' object has no attribute 'set_binding_shape'

when I run the demo :python3 examples/basic_usage.py \ --image_encoder="data/resnet18_image_encoder.engine" \ --mask_decoder="data/mobile_sam_mask_decoder.engine" I got this error on the above. could you please help me? thanks!!!!!!

countlesswu commented 9 months ago

ok fine.. I solved it. The reason: it needs cuBLASLt 11.10.3.0, but my CUDA is 11.7, don't match it, so need to update CUDA to 11.8. By the way, the Cudatoolkit needs attention, it may affect the CUDA update.