-
-
Notifications
You must be signed in to change notification settings - Fork 17.4k
After update cannot redirect output to file anymore. #5960
Description
Search before asking
- I have searched the YOLOv5 issues and found no similar bug report.
YOLOv5 Component
Detection
Bug
After update I have noticed that detect.py behavior has changed
If I launch this command with latest version of yolov5:
python3 detect.py --weights weights/yolov5x6.pt --classes 0 --conf-thres 0.71 --img-size=1280 --source /archivio/Evento-1035663-VialeSilvia-00026-capture.jpg --project /dev/shm/test/ > /tmp/anal.log
The output file /tmp/anal.log is empty.
root@videosorveglianza:/scripts/yolov5_last# python3 detect.py --weights weights/yolov5x6.pt --classes 0 --conf-thres 0.71 --img-size=1280 --source /archivio/Evento-1035663-VialeSilvia-00026-capture.jpg --project /dev/shm/test/ > /tmp/anal.log
detect: weights=['weights/yolov5x6.pt'], source=/archivio/Evento-1035663-VialeSilvia-00026-capture.jpg, imgsz=[1280, 1280], conf_thres=0.71, iou_thres=0.45, max_det=1000, device=, view_img=False, save_txt=False, save_conf=False, save_crop=False, nosave=False, classes=[0], agnostic_nms=False, augment=False, visualize=False, update=False, project=/dev/shm/test/, name=exp, exist_ok=False, line_thickness=3, hide_labels=False, hide_conf=False, half=False, dnn=False
YOLOv5 🚀 v6.0-139-g8f35436 torch 1.10.0+cu102 CUDA:0 (NVIDIA GeForce GTX 1060 6GB, 6078MiB)
Fusing layers...
Model Summary: 574 layers, 140730220 parameters, 0 gradients
image 1/1 /archivio/Evento-1035663-VialeSilvia-00026-capture.jpg: 768x1280 Done. (0.168s)
Speed: 0.7ms pre-process, 168.2ms inference, 0.8ms NMS per image at shape (1, 3, 1280, 1280)
Results saved to /dev/shm/test/exp
root@videosorveglianza:/scripts/yolov5_last# ls -altr /tmp/anal.log
-rw-r--r-- 1 root root 0 12 dic 15.48 /tmp/anal.log
If I launch this command on version 6-0-35 output file has the output I need:
root@videosorveglianza:/scripts/yolov5_6# python3 detect.py --weights weights/yolov5x6.pt --classes 0 --conf-thres 0.71 --img-size=1280 --source /archivio/Evento-1035663-VialeSilvia-00026-capture.jpg --project /dev/shm/test/ > /tmp/anal.log
YOLOv5 🚀 v6.0-35-ga4fece8 torch 1.10.0+cu102 CUDA:0 (NVIDIA GeForce GTX 1060 6GB, 6077.9375MB)
Fusing layers...
/usr/local/lib/python3.9/dist-packages/torch/functional.py:445: UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing argument. (Triggered internally at ../aten/src/ATen/native/TensorShape.cpp:2157.)
return _VF.meshgrid(tensors, **kwargs) # type: ignore[attr-defined]
Model Summary: 574 layers, 140730220 parameters, 0 gradients
root@videosorveglianza:/scripts/yolov5_6# cat /tmp/anal.log
detect: weights=['weights/yolov5x6.pt'], source=/archivio/Evento-1035663-VialeSilvia-00026-capture.jpg, imgsz=[1280, 1280], conf_thres=0.71, iou_thres=0.45, max_det=1000, device=, view_img=False, save_txt=False, save_conf=False, save_crop=False, nosave=False, classes=[0], agnostic_nms=False, augment=False, visualize=False, update=False, project=/dev/shm/test/, name=exp, exist_ok=False, line_thickness=3, hide_labels=False, hide_conf=False, half=False, dnn=False
image 1/1 /archivio/Evento-1035663-VialeSilvia-00026-capture.jpg: 768x1280 Done. (0.268s)
Speed: 2.2ms pre-process, 267.7ms inference, 11.6ms NMS per image at shape (1, 3, 1280, 1280)
Results saved to /dev/shm/test/exp7
Environment
YOLOv5 🚀 v6.0-139-g8f35436 torch 1.10.0+cu102 CUDA:0 (NVIDIA GeForce GTX 1060 6GB, 6078MiB)
Debian 11
Python 3.9.2
Minimal Reproducible Example
python3 detect.py > /tmp/output.log
Additional
No response
Are you willing to submit a PR?
- Yes I'd like to help by submitting a PR!