【发布时间】:2019-08-28 09:08:10
【问题描述】:
我在尝试初始化暗网时收到此错误。
错误: cv::dnn::darknet::ReadDarknetFromCfgStream 中的断言失败 (separator_index
有人知道会发生什么吗?
我正在使用yolov3.weights 和yolov3.cfg
下面的一段代码。
我试过绝对文件路径
// Load names of classes
string classesFile = "B:/coco.names";
ifstream ifs(classesFile.c_str());
string line;
while (getline(ifs, line)) classes.push_back(line);
// Give the configuration and weight files for the model
String modelConfiguration = "B:/yolov3a.cfg";
String modelWeights = "B:/yolov3.weights";
// Load the network
Net net = readNetFromDarknet(modelConfiguration, modelWeights);
net.setPreferableBackend(DNN_BACKEND_OPENCV);
net.setPreferableTarget(DNN_TARGET_CPU);
//---------------
return 0;
感谢任何帮助
【问题讨论】:
-
仔细检查您的 .cfg 文件。您可能会无意中忽略了一些评论,例如#Testing 或类似的内容。