Repository navigation
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
YOLOv5 Component
Detection
Bug
after run python3 detect.py --source 0 --weights yolov5s.pt --conf 0.25
The webcam only capture ONE FRAME.
/Users/Aaron/miniforge3/envs/yolov5/lib/python3.9/site-packages/torchvision/io/image.py:11: UserWarning: Failed to load image Python extension:
warn(f"Failed to load image Python extension: {e}")
detect: weights=['yolov5s.pt'], source=0, data=data/coco128.yaml, imgsz=[640, 640], conf_thres=0.25, 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 🚀 v6.0-174-g7b31a53 torch 1.10.1 CPU
Fusing layers...
Model Summary: 213 layers, 7225885 parameters, 0 gradients
1/1: 0... Success (inf frames 1280x720 at nan FPS)
Exception in thread Thread-1:
Traceback (most recent call last):
File "/Users/Aaron/miniforge3/envs/yolov5/lib/python3.9/threading.py", line 973, in _bootstrap_inner
self.run()
File "/Users/Aaron/miniforge3/envs/yolov5/lib/python3.9/threading.py", line 910, in run
self._target(*self._args, **self._kwargs)
File "/Users/Aaron/yolov5/utils/datasets.py", line 341, in update
time.sleep(1 / self.fps[i]) # wait time
ValueError: Invalid value NaN (not a number)
0: 384x640 1 person, Done. (0.109s)
Speed: 1.0ms pre-process, 108.9ms inference, 0.5ms NMS per image at shape (1, 3, 640, 640)
Results saved to runs/detect/exp11
Environment
- YOLOv5
- OS: macOS 12.1
- Python 3.9
- Apple M1 Chip
Minimal Reproducible Example
After run python3 detect.py --source 0 --weights yolov5s.pt --conf 0.25
The webcam only capture ONE FRAME then stoped.
A 0 sec mp4 detect result can be generated in detect\exp* folder.
It also happens when I connect to an external camera via USB.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Activity
github-actions commentedon Jan 5, 2022
👋 Hello @zydisney, thank you for your interest in YOLOv5 🚀! Please visit our ⭐️ Tutorials to get started, where you can find quickstart guides for simple tasks like Custom Data Training all the way to advanced concepts like Hyperparameter Evolution.
If this is a 🐛 Bug Report, please provide screenshots and minimum viable code to reproduce your issue, otherwise we can not help you.
If this is a custom training ❓ Question, please provide as much information as possible, including dataset images, training logs, screenshots, and a public link to online W&B logging if available.
For business inquiries or professional support requests please visit https://ultralytics.com or email Glenn Jocher at glenn.jocher@ultralytics.com.
Requirements
Python>=3.6.0 with all requirements.txt installed including PyTorch>=1.7. To get started:
Environments
YOLOv5 may be run in any of the following up-to-date verified environments (with all dependencies including CUDA/CUDNN, Python and PyTorch preinstalled):
Status
If this badge is green, all YOLOv5 GitHub Actions Continuous Integration (CI) tests are currently passing. CI tests verify correct operation of YOLOv5 training (train.py), validation (val.py), inference (detect.py) and export (export.py) on MacOS, Windows, and Ubuntu every 24 hours and on every commit.
Fix `nan`-robust stream FPS
Fix `nan`-robust stream FPS (#6198)
glenn-jocher commentedon Jan 5, 2022
@zydisney good news 😃! Your original issue may now be fixed ✅ in PR #6198. This PR fixes a cv2
nanframerate bug that had occured on streaming sources.To receive this update:
git pullfrom within youryolov5/directory orgit clone https://github.com/ultralytics/yolov5againmodel = torch.hub.load('ultralytics/yolov5', 'yolov5s', force_reload=True)sudo docker pull ultralytics/yolov5:latestto update your imageThank you for spotting this issue and informing us of the problem. Please let us know if this update resolves the issue for you, and feel free to inform us of any other issues you discover or feature requests that come to mind. Happy trainings with YOLOv5 🚀!
Update Neuralmagic-YoloV5 integration to v6.1 (#29)
Fix `nan`-robust stream FPS (ultralytics#6198)