【发布时间】:2018-01-16 18:21:25
【问题描述】:
我按照他们的指导使用 Tensorflow 的对象检测 API 训练了一个模型。我还生成了用于部署的文件,并正在尝试对图像进行分类。 OpenCV 的 DNN 文件可以使用 readNetFromTensorflow 加载图形而不会出错,但是当我尝试设置网络输入并调用 .forward() 时,它会给出以下错误。我一直在寻找解决这个问题的方法,但是我一直找不到任何东西可以为我指明正确的方向。任何帮助将不胜感激。
[INFO] loading model...
[INFO] starting video stream...
[ INFO:0] Initialize OpenCL runtime...
OpenCV Error: Assertion failed (int(numPriors * _numClasses) == inputs[1][1]) in getMemoryShapes, file /home/pi/opencv/modules/dnn/src/layers/detection_output_layer.cpp, line 202
Traceback (most recent call last):
File "real_time_object_detection.py", line 68, in <module>
detections = net.forward()
cv2.error: /home/pi/opencv/modules/dnn/src/layers/detection_output_layer.cpp:202: error: (-215) int(numPriors * _numClasses) == inputs[1][1] in function getMemoryShapes
【问题讨论】:
-
请说明训练了什么样的模型以及对配置文件进行了哪些更改。例如,这是 MobileNet-SSD 的配置:github.com/tensorflow/models/blob/master/research/…
标签: python-3.x opencv object-detection