我在使用 google colab 时遇到了一些问题:
当我尝试用 编译暗网时LIBSO=1
,#define TRACK_OPTFLOW
我收到此错误消息:
...
In file included from src/yolo_console_dll.cpp:23:0:
include/yolo_v2_class.hpp:233:10: fatal error: opencv2/cudaoptflow.hpp: No such file or directory
#include <opencv2/cudaoptflow.hpp>
^~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Makefile:155: recipe for target 'uselib' failed
make: *** [uselib] Error 1
然后我将丢失的 .hpp 文件添加到 colab 内的新 opencv2 文件夹中,但我遇到了另一个问题,
/tmp/ccRQih9B.o: In function `Tracker_optflow::tracking_flow(cv::Mat, bool)':
yolo_console_dll.cpp:(.text._ZN15Tracker_optflow13tracking_flowEN2cv3MatEb[_ZN15Tracker_optflow13tracking_flowEN2cv3MatEb]+0x108): undefined reference to `cv::cuda::cvtColor(cv::_InputArray const&, cv::_OutputArray const&, int, int, cv::cuda::Stream&)'
/tmp/ccRQih9B.o: In function `Tracker_optflow::update_tracking_flow(cv::Mat, std::vector<bbox_t, std::allocator<bbox_t> >)':
yolo_console_dll.cpp:(.text._ZN15Tracker_optflow20update_tracking_flowEN2cv3MatESt6vectorI6bbox_tSaIS3_EE[_ZN15Tracker_optflow20update_tracking_flowEN2cv3MatESt6vectorI6bbox_tSaIS3_EE]+0x2aa): undefined reference to `cv::cuda::cvtColor(cv::_InputArray const&, cv::_OutputArray const&, int, int, cv::cuda::Stream&)'
yolo_console_dll.cpp:(.text._ZN15Tracker_optflow20update_tracking_flowEN2cv3MatESt6vectorI6bbox_tSaIS3_EE[_ZN15Tracker_optflow20update_tracking_flowEN2cv3MatESt6vectorI6bbox_tSaIS3_EE]+0x332): undefined reference to `cv::cuda::cvtColor(cv::_InputArray const&, cv::_OutputArray const&, int, int, cv::cuda::Stream&)'
/tmp/ccRQih9B.o: In function `main':
yolo_console_dll.cpp:(.text.startup+0x7d7): undefined reference to `cv::cuda::SparsePyrLKOpticalFlow::create(cv::Size_<int>, int, int, bool)'
collect2: error: ld returned 1 exit status
Makefile:155: recipe for target 'uselib' failed
make: *** [uselib] Error 1
我想这是一个 Colab 的问题,