OpenCV3.3 dnn.readNetFromTensorflow() cannot load the module

扶醉桌前 提交于 2020-01-01 03:56:06

问题


First,I use the OpenCV3.3 and the Python3.6. When I use net=cv2.dnn.readNetFromCaffe('MobileNetSSD.prototxt.txt','MobileNetSSD_deploy.caffemodel').It works

The question is when I load the tensorflow module,there is an error: My code is

net = cv2.dnn.readNetFromTensorflow('frozen_inference_graph_face.pb')

The wrong message is

  Traceback (most recent call last):
      File "F:/real-time-object-detection/real_time_object_detection.py", line 34, in <module>
        net = cv2.dnn.readNetFromTensorflow('frozen_inference_graph_face.pb')
    cv2.error: D:\Build\OpenCV\opencv-3.3.0\modules\dnn\src\tensorflow\tf_importer.cpp:883: error: (-2) Unknown layer type Cast in op ToFloat in function cv::dnn::experimental_dnn_v1::`anonymous-namespace'::TFImporter::populateNet

Please help me ,thank you very much!

来源:https://stackoverflow.com/questions/46386618/opencv3-3-dnn-readnetfromtensorflow-cannot-load-the-module

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