【问题标题】:How to run the "make" command for YoloV3 Darknet (for Windows)?如何运行 YoloV3 Darknet 的“make”命令(适用于 Windows)?
【发布时间】:2019-07-11 22:35:42
【问题描述】:

运行 ./make.exe 命令后(通过使用 GNUWin32),我收到以下错误:

mkdir -p obj   
mkdir -p backup   
A subdirectory or file -p already exists.  
Error occurred while processing: -p. make: *** [backup] Error 1

重新运行命令后,我得到一个不同的错误:

mkdir -p results
A subdirectory or file -p already exists.
Error occurred while processing: -p.
make: *** [results] Error 1

然后无论我重复make命令多少次,我都会得到同样的错误:

gcc -Iinclude/ -Isrc/ -Wall -Wno-unused-result -Wno-unknown-pragmas -Wfatal-errors -fPIC -Ofast -c ./src/gemm.c -o obj/gemm.o
process_begin: CreateProcess(NULL, gcc -Iinclude/ -Isrc/ -Wall -Wno-unused-result -Wno-unknown-pragmas -Wfatal-errors -fPIC -Ofast -c ./src/gemm.c -o obj/gemm.o, ...) failed.
make (e=2): The system cannot find the file specified.
make: *** [obj/gemm.o] Error 2

由于我是初学者,您能否提供有关如何解决问题的详细说明?

【问题讨论】:

    标签: windows makefile darknet gnuwin32


    【解决方案1】:

    这些问题:

    mkdir -p obj   
    mkdir -p backup   
    A subdirectory or file -p already exists.  
    Error occurred while processing: -p. make: *** [backup] Error 1
    

    是由于您要求 Make 在 Windows 上执行, 为在 Linux 或其他类 Unix 操作系统上工作而编写的 makefile。

    在类 Unix 操作系统中,命令:

    mkdir -p obj
    

    意思是:创建一个名为obj的目录如果它已经存在则没有错误。在 Windows 意味着:创建一个名为 -p 的目录然后创建一个名为 obj 的目录。

    所以当mkdir -p obj创建了目录-pobj时,命令:

    mkdir -p backup
    

    失败是因为:

    A subdirectory or file -p already exists.
    

    Unix/Linux makefile 无意创建一个名为 -p 的目录,但在 Windows 上 这就是它的作用。

    您尝试修复此特定错误毫无意义。这只是 尝试执行 Unix/Linux 会导致无数错误中的第一个 Windows 上的生成文件。您需要一个编写的生成文件以在其上运行 Windows,或者自己编写一个,或者找到一种在不使用 Make 的 Windows 上构建软件的方法。

    这个问题:

    gcc -Iinclude/ -Isrc/ -Wall -Wno-unused-result -Wno-unknown-pragmas -Wfatal-errors -fPIC -Ofast -c ./src/gemm.c -o obj/gemm.o
    process_begin: CreateProcess(NULL, gcc -Iinclude/ -Isrc/ -Wall -Wno-unused-result -Wno-unknown-pragmas -Wfatal-errors -fPIC -Ofast -c ./src/gemm.c -o obj/gemm.o, ...) failed.
    make (e=2): The system cannot find the file specified.
    make: *** [obj/gemm.o] Error 2
    

    是因为你没有安装GCC C编译器造成的 gcc 在您的计算机上,或者如果您有,它所在的目录不在您的PATH 中。所以Make找不到 它执行编译和链接软件的基本业务。

    这里是a popular Windows port of GCC

    【讨论】:

    • 非常感谢您以如此详细的方式进行解释。你知道有什么方法可以在 Windows 中运行 YOLOv3 暗网吗?
    • @RedGod 我不会,但谷歌搜索“在 Windows 上安装 YOLOv3 暗网”会产生命中。
    【解决方案2】:

    您的 makefile 是为 Linux 编写的,不能直接移植到 Windows。 问题是“mkdir”与不支持相同命令行选项的 CMD 内置函数冲突(如 Mike Kinghan 所解释)。

    一个简单的解决方法是用$(MKDIR) 替换您的makefile 中出现的mkdir 并在开头添加:

    MKDIR := “$(shell which mkdir)”
    

    当然,这需要您安装whichCoreUtils(提供mkdir)。请注意双引号以避免 mkdir 路径上出现任何空白问题。

    最后但并非最不重要的一点是,您还需要 gcc,例如可以获取 herethere

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-06-06
      • 1970-01-01
      • 2021-02-25
      • 2022-08-19
      • 2010-12-24
      • 2018-11-08
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多