NVIDIA-AI-IOT / nanosam

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

Usage problem in PC : ) #23

Open P1nkDeft opened 6 months ago

P1nkDeft commented 6 months ago

hi I'm more than happy to try this excellent work on my nano machine, and I also wanna try this work on my PC device. But the problem came up to me when try to follow the guide to run the ''basic_usage.py'', the detail informathion of the problem was:

*File "C:\Users\Administrator\Desktop\nanosam-main\examples\basicusage.py", line 50, in mask, , _ = predictor.predict(points, point_labels) File "c:\users\administrator\desktop\nanosam-main\nanosam\utils\predictor.py", line 164, in predict mask_iou, low_res_mask = run_mask_decoder( File "c:\users\administrator\desktop\nanosam-main\nanosam\utils\predictor.py", line 114, in run_mask_decoder iou_predictions, low_res_masks = mask_decoder_engine( File "C:\Program Files\anaconda\envs\nanosam\lib\site-packages\torch\nn\modules\module.py", line 1194, in _call_impl return forward_call(input, kwargs) File "C:\Program Files\anaconda\envs\nanosam\lib\site-packages\torch2trt-0.4.0-py3.8.egg\torch2trt\torch2trt.py", line 616, in forward
self.context.set_binding_shape(idx, shape) AttributeError: 'NoneType' object has no attribute 'set_binding_shape'

and I have try my best to solve this problem, but I couldn't find a clue, can you help me ?

THANKS!!

RuiXing123 commented 1 month ago

Hello, I have encountered similar problems. I understand that it may be related to the new version of TensorRT. New versions of TensorRT may remove this API. Maybe a reduced version would work, but I haven't tried it yet. Have you solved the problem? Thank you! 微信图片编辑_20240724134346