OpenBLAS警告:检测OpenMP循环,此应用程序可能挂在Raspberry Pi 4上

2024-03-29 11:06:56 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在Manjaro OS(arm-Manjaro)上运行Raspberry Pi 4 Model B(4GB RAM)上的YOLOv5工具。 在安装了该工具所需的该特定体系结构(aarch64)的所有要求后,它的推理任务(detect.py文件)做得非常好,但我遇到了一个问题,除了它的工作速度慢(大约每帧1-2秒),它显示了以下内容:

OpenBLAS Warning : Detect OpenMP Loop and this application may hang. Please rebuild the library with USE_OPENMP=1 option.

大概15次。但如果是torch、opencv或其他调用OpenBLAS的库(我甚至不知道OpenBLAS的用途),我不确定是什么导致了这个问题,但我担心错误应该出现在这一行中

# detect.py # Process detections

    for i, det in enumerate(pred):  # detections per image
        if webcam:  # batch_size >= 1
            p, s, im0, frame = path[i], '%g: ' % i, im0s[i].copy(), dataset.count
        else:
            p, s, im0, frame = path, '', im0s, getattr(dataset, 'frame', 0)
        p = Path(p)  # to Path
        save_path = str(save_dir / p.name)  # img.jpg
        txt_path = str(save_dir / 'labels' / p.stem) + ('' if dataset.mode == 'image' else f'_{frame}')  # img.txt
        s += '%gx%g ' % img.shape[2:]  # print string
        gn = torch.tensor(im0.shape)[[1, 0, 1, 0]]  # normalization gain whwh
        if len(det):
            # Rescale boxes from img_size to im0 size
            det[:, :4] = scale_coords(img.shape[2:], det[:, :4], im0.shape).round()
            # Print results
            for c in det[:, -1].unique():
                n = (det[:, -1] == c).sum()  # detections per class
                s += f"{n} {names[int(c)]}{'s' * (n > 1)}, "  # add to string
            # Write results
            for *xyxy, conf, cls in reversed(det):
                if save_txt:  # Write to file
                    xywh = (xyxy2xywh(torch.tensor(xyxy).view(1, 4)) / gn).view(-1).tolist()  # normalized xywh
                    line = (cls, *xywh, conf) if opt.save_conf else (cls, *xywh)  # label format
                    with open(txt_path + '.txt', 'a') as f:
                        f.write(('%g ' * len(line)).rstrip() % line + '\n')
                if save_img or view_img:  # Add bbox to image
                    label = f'{names[int(cls)]} {conf:.2f}'
                    plot_one_box(xyxy, im0, label=label, color=colors[int(cls)], line_thickness=3)

因为在完成推理(检测)之后,它显示了脚本的下一部分,即推理所用的时间

任何帮助都将不胜感激


Tags: topathtxtimgifsaveconfline