gpt4 book ai didi

c++ - YOLO 神经网络未在 VS13 中编译

转载 作者:太空宇宙 更新时间:2023-11-03 22:50:42 25 4
gpt4 key购买 nike

我正在尝试使用 YOLO在 VS13 中,但它没有编译。我用的是 this (这给了我 this 错误)现在我正在尝试 this (这不是编译)。如果我使用opencv 2.4.13,错误是

Error   1075    error LNK1104: cannot open file 'opencv_core249.lib'    

(下载这个库没有帮助并导致另一个链接器错误)

如果我使用 opencv 3.1.0,则会出现此错误

Error   14  error : this declaration may not have extern "C" linkage    C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\limits   78  1   darknet

我找到了 solution这对我不起作用,因为如果我删除

#ifdef OPENCV
#include "opencv2/highgui/highgui_c.h"
#include "opencv2/imgproc/imgproc_c.h"
#endif

从 image.h,并将其添加到 image.c(通常它已经在 image.c 中,所以我只是从 image.h 中删除这一行)错误在这一行中出现(image.h)

#ifdef OPENCV
void save_image_jpg(image p, char *name);
image get_image_from_stream(CvCapture *cap);
image ipl_to_image(IplImage* src);
#endif

(未定义 CvCapture 和 IplImage)

那么,如何在windows中使用YOLO呢?我应该在 frischzenger 或 AlexeyAB 解决方案中修复什么?

最佳答案

在 Windows 7/8/10/Server 上有两个版本的 Yolo-Darknet:v1(旧)和 v2(新)。

  1. Yolo v1:https://github.com/AlexeyAB/yolo-windows - 可以在 MSVS 2013

  2. 上编译
  3. Yolo v2(自 2016 年 11 月 17 日起):https://github.com/AlexeyAB/darknet - 可以在 MSVS 2015 或 MSVS 2013 (12.0.40629.00 update 5) 上编译,但不能在 MSVS 2013 (12.0.21005.1) 上编译

如何编译当前版本的 Yolo v2 你可以在那里阅读:https://github.com/AlexeyAB/yolo-windows#how-to-compile

关于您的问题:

I'm trying to use YOLO https://github.com/AlexeyAB/yolo-windows in VS13, but it's not compiling. I was using this (which gave me this error) and now I'm trying this (which is not compiling). If I use opencv 2.4.13, the error is

Error 1075 error LNK1104: cannot open file 'opencv_core249.lib'

  1. 在旧的 Yolo v1 中,要使用 OpenCV 2.4.13 而不是 2.4.9,您应该将 #pragma comment(lib, "opencv_core249.lib") 更改为 #pragma comment(lib, "opencv_core2413.lib") 在文件中:

    • yolo_demo.c
    • yolo_kernels.cu
  2. 在新的 Yolo v2 中,要使用 OpenCV 2.4.13 而不是 2.4.9,您应该打开文件:\src\yolo.c 并将 3 行更改为您的 OpenCV 版本 - 249(对于 2.4.9),2413(对于 2.4.13),...:

    • #pragma comment(lib, "opencv_core249.lib")
    • #pragma comment(lib, "opencv_imgproc249.lib")
    • #pragma comment(lib, "opencv_highgui249.lib")

最好使用 Yolo v2,因为它具有更高的速度和准确性: enter image description here

关于c++ - YOLO 神经网络未在 VS13 中编译,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38324557/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com