WongKinYiu / yolov7

Implementation of paper - YOLOv7: Trainable bag-of-freebies sets new state-of-the-art for real-time object detectors
GNU General Public License v3.0
13.21k stars 4.17k forks source link

is 3080ti not enought to run mask? #847

Closed getarobo closed 1 year ago

getarobo commented 1 year ago
python detect.py --weight yolov7-mask.pt --source person.jpeg --name person_mask
Namespace(agnostic_nms=False, augment=False, classes=None, conf_thres=0.25, device='', exist_ok=False, img_size=640, iou_thres=0.45, name='person_mask', no_trace=False, nosave=False, project='runs/detect', save_conf=False, save_txt=False, source='person.jpeg', update=False, view_img=False, weights=['yolov7-mask.pt'])
YOLOR 🚀 v0.1-107-gfb79783 torch 1.11.0+cu113 CUDA:0 (NVIDIA GeForce RTX 3080 Ti, 12031.3125MB)

Traceback (most recent call last):
  File "detect.py", line 195, in <module>
    detect()
  File "detect.py", line 34, in detect
    model = attempt_load(weights, map_location=device)  # load FP32 model
  File "/home/gene/workspace/yolov7_gene/models/experimental.py", line 242, in attempt_load
    ckpt = torch.load(w, map_location=map_location)  # load
  File "/home/gene/anaconda3/envs/yolov7/lib/python3.8/site-packages/torch/serialization.py", line 712, in load
    return _load(opened_zipfile, map_location, pickle_module, **pickle_load_args)
  File "/home/gene/anaconda3/envs/yolov7/lib/python3.8/site-packages/torch/serialization.py", line 1046, in _load
    result = unpickler.load()
  File "/home/gene/anaconda3/envs/yolov7/lib/python3.8/site-packages/torch/serialization.py", line 1016, in persistent_load
    load_tensor(dtype, nbytes, key, _maybe_decode_ascii(location))
  File "/home/gene/anaconda3/envs/yolov7/lib/python3.8/site-packages/torch/serialization.py", line 1001, in load_tensor
    wrap_storage=restore_location(storage, location),
  File "/home/gene/anaconda3/envs/yolov7/lib/python3.8/site-packages/torch/serialization.py", line 973, in restore_location
    return default_restore_location(storage, str(map_location))
  File "/home/gene/anaconda3/envs/yolov7/lib/python3.8/site-packages/torch/serialization.py", line 176, in default_restore_location
    result = fn(storage, location)
  File "/home/gene/anaconda3/envs/yolov7/lib/python3.8/site-packages/torch/serialization.py", line 158, in _cuda_deserialize
    return obj.cuda(device)
  File "/home/gene/anaconda3/envs/yolov7/lib/python3.8/site-packages/torch/_utils.py", line 79, in _cuda
    return new_type(self.size()).copy_(self, non_blocking)
  File "/home/gene/anaconda3/envs/yolov7/lib/python3.8/site-packages/torch/cuda/__init__.py", line 661, in _lazy_new
    return super(_CudaBase, cls).__new__(cls, *args, **kwargs)
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.

I am trying to run segmentation from mask branch, and I am getting RuntimeError: CUDA error: out of memory Perhaps my rtx 3080ti is not strong enought for this?

I tried using u7 branch's detect.py but common.py was missing alot of classses.

Is my gpu the problem or some is my set up messed up?

love yall~!

getarobo commented 1 year ago

found out it was my torch version problem

647