首先,我使用 OpenCV3.3 和 Python3.6。当我使用
net=cv2.dnn.readNetFromCaffe('MobileNetSSD.prototxt.txt','MobileNetSSD_deploy.caffemodel')
.It 工作
问题是当我加载 tensorflow 模块时,出现错误:我的代码是
net = cv2.dnn.readNetFromTensorflow('frozen_inference_graph_face.pb')
错误信息是
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
请帮助我,非常感谢!