问题遇到的现象和发生背景
使用YOLOv5的detect.py来验证是否安装成功,结果运行的时候出不来目标检测的图片
C:\ProgramData\Anaconda3\envs\yolov5\python.exe E:/yolov5/detect.py
detect: weights=yolov5s.pt, source=0, data=data\coco128.yaml, imgsz=[640, 640], conf_thres=0.5, iou_thres=0.45, max_det=1000, device=, view_img=False, save_txt=False, save_conf=False, save_crop=False, nosave=False, classes=None, agnostic_nms=False, augment=False, visualize=False, update=False, project=runs\detect, name=exp, exist_ok=False, line_thickness=3, hide_labels=False, hide_conf=False, half=False, dnn=False
YOLOv5 2022-6-28 Python-3.10.4 torch-1.12.0 CUDA:0 (NVIDIA GeForce RTX 3060, 12288MiB)
Fusing layers...
YOLOv5s summary: 213 layers, 7225885 parameters, 0 gradients
Traceback (most recent call last):
File "E:\yolov5\detect.py", line 256, in <module>
main(opt)
File "E:\yolov5\detect.py", line 251, in main
run(**vars(opt))
File "C:\ProgramData\Anaconda3\envs\yolov5\lib\site-packages\torch\autograd\grad_mode.py", line 27, in decorate_context
return func(*args, **kwargs)
File "E:\yolov5\detect.py", line 100, in run
dataset = LoadStreams(source, img_size=imgsz, stride=stride, auto=pt)
File "E:\yolov5\utils\dataloaders.py", line 328, in __init__
assert cap.isOpened(), f'{st}Failed to open {s}'
AssertionError: 1/1: 0... Failed to open 0
进程已结束,退出代码1
看不出来是什么问题,也不知道怎么去解决,求指点