OpenCV dnn exception SSD Mobilenetv2

╄→尐↘猪︶ㄣ 提交于 2021-01-28 19:05:54

问题


Using transfer learning, I trained SSD MobileNetV2 (ssd_mobilenet_v2_coco.config) model in TensorFlow (tensorflow-gpu==1.15.0). After freezing the graph (.pb) using TensorFlow API Python script (export_inference_graph.py), I created a text graph (.pbtxt) using the Python script provided in OpenCV wiki (tf_text_graph_ssd.py).

I used the Python code snippet from the wiki to test inference, but I am getting the following error:

cv2.error: OpenCV(4.2.0) C:\projects\opencv-python\opencv\modules\dnn\src\dnn.cpp:562: error: (-2:Unspecified error) Can't create layer "FeatureExtractor/MobilenetV2/expanded_conv_2/add" of type "AddV2" in function 'cv::dnn::dnn4_v20191202::LayerData::getLayerInstance'

I am using Windows 10, Python 3.6.8, and OpenCV 4.2.0.32. I have tried downgrading OpenCV, but earlier versions give different errors.

However, in Ubuntu 18.04.4, installing OpenCV from source, I do not get any errors. Does anybody know if this is an incompatible layer in binary wheels of OpenCV for Windows? Should I wait until the next release?

来源:https://stackoverflow.com/questions/60840403/opencv-dnn-exception-ssd-mobilenetv2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!