问题
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