z-x-yang / Segment-and-Track-Anything

An open-source project dedicated to tracking and segmenting any objects in videos, either automatically or interactively. The primary algorithms utilized include the Segment Anything Model (SAM) for key-frame segmentation and Associating Objects with Transformers (AOT) for efficient tracking and propagation purposes.
GNU Affero General Public License v3.0
2.83k stars 340 forks source link

如何修改推理使用的显卡号 #87

Closed ql390962 closed 12 months ago

ql390962 commented 1 year ago

我的机器上有多张显卡,但是0卡已经被占用,需要使用其他显卡。我尝试将model.args中gpu_id修改为2,但是推理依然占用0卡,导致出现以下错误。 RuntimeError: CUDA error: out of memory CUDA kernel errors might be asynchronously reported at some other API call,so the stacktrace below might be incorrect. For debugging consider passing CUDA_LAUNCH_BLOCKING=1. 请问如何才能选择其他显卡运行模型。

hsdjkfnsfc commented 1 year ago

For me , just set export CUDA_VISIBLE_DEVICES=idx can solve you problem