zqfang / YOLOv3_CPP

YOLOv3 C++
16 stars 8 forks source link

你好,最后在make后报错 #3

Open WANGCHAO1996 opened 3 years ago

WANGCHAO1996 commented 3 years ago

[100%] Linking CXX executable ../bin/yolov3 CMakeFiles/yolov3.dir/main.cpp.o:在函数‘(anonymous namespace)::drawtext(cv::Mat&, std::string const&, cv::Scalar const&, cv::Point_, bool)’中: main.cpp:(.text+0x5f7):对‘cv::getTextSize(std::string const&, int, double, int, int*)’未定义的引用 main.cpp:(.text+0x82a):对‘cv::putText(cv::InputOutputArray const&, std::string const&, cv::Point, int, double, cv::Scalar_, int, int, bool)’未定义的引用 CMakeFiles/yolov3.dir/main.cpp.o:在函数‘main’中: main.cpp:(.text+0xee5):对‘cv::glob(std::string, std::vector<std::string, std::allocator >&, bool)’未定义的引用 main.cpp:(.text+0xfd5):对‘cv::imread(std::string const&, int)’未定义的引用 main.cpp:(.text+0x13fa):对‘cv::imwrite(std::string const&, cv::_InputArray const&, std::vector<int, std::allocator > const&)’未定义的引用 ../detection/libdetection.so:对‘c10::impl::ExcludeDispatchKeyGuard::ExcludeDispatchKeyGuard(c10::DispatchKey)’未定义的引用 ../detection/libdetection.so:对‘at::batch_norm(at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, at::Tensor const&, bool, double, double, bool)’未定义的引用 collect2: error: ld returned 1 exit status yolov3/CMakeFiles/yolov3.dir/build.make:176: recipe for target 'bin/yolov3' failed make[2]: [bin/yolov3] Error 1 CMakeFiles/Makefile2:133: recipe for target 'yolov3/CMakeFiles/yolov3.dir/all' failed make[1]: [yolov3/CMakeFiles/yolov3.dir/all] Error 2 Makefile:102: recipe for target 'all' failed make: *** [all] Error 2

WANGCHAO1996 commented 3 years ago

请问这是opencv的问题吗?ubuntu18.4 opencv4.1.1 libtorch=1.6.0

zqfang commented 3 years ago

这个似乎是opencv的lib没有被找到。

WANGCHAO1996 commented 3 years ago

这个似乎是opencv的lib没有被找到。 这个问题怎么解决,需要编译libtorch吗,我是直接用的官网编译好的libtorch

zqfang commented 3 years ago

设置的你cmakelist.txt, opencv 路径不对

WANGCHAO1996 commented 3 years ago

make 成功了 生成了一个yolov3 文件夹 图片 然后执行yolov3 models/yolov3.cfg models/yolov3.weights images 报错:yolov3:未找到命令

zqfang commented 3 years ago

补全编译出来的二进制文件路径。应该在bin文件里

WANGCHAO1996 commented 3 years ago

补全编译出来的二进制文件路径。应该在bin文件里

你好,bin文件确实有YOLOv3一个文件,我cd到bin文件里面 然后执行yolov3 models/yolov3.cfg models/yolov3.weights images 报错:yolov3:未找到命令

YMJMZ commented 2 years ago

在Ubuntu系统下只能用cxx11 ABI的libtorch 不能用 Pre的. 不然就会有undefined reference ... 这个好像是所有用Libtorch本身的bug。 单独使用opencv并不会出现这个问题,但是用了libtorch就会又这个bug..