spmallick / learnopencv

Learn OpenCV : C++ and Python Examples
https://www.learnopencv.com/
20.98k stars 11.56k forks source link

net = cv2.dnn.readNetFromCaffe(protoFile, weightsFile) cv2.error: OpenCV(4.2.0) C:\projects\opencv-python\opencv\modules\dnn\src\caffe\caffe_io.cpp:1132: error: (-2:Unspecified error) FAILED: fs.is_open(). Can't open "pose/coco/pose_iter_440000.caffemodel" in function 'cv::dnn::ReadProtoFromBinaryFile' #409

Open arunvarma99910 opened 4 years ago

arunvarma99910 commented 4 years ago

File "E:\New folder\multi-person-openpose.py", line 166, in
net = cv2.dnn.readNetFromCaffe(protoFile, weightsFile) cv2.error: OpenCV(4.2.0) C:\projects\opencv-python\opencv\modules\dnn\src\caffe\caffe_io.cpp:1132: error: (-2:Unspecified error) FAILED: fs.is_open(). Can't open "pose/coco/pose_iter_440000.caffemodel" in function 'cv::dnn::ReadProtoFromBinaryFile'

alperenkara commented 4 years ago

These model files are corrupt or not suitable for new version of OpenCV. You can download these model files from somewhere else.

LeylaKhaleghi commented 4 years ago

I had the same error, after downloading pose_deploy.prototxt file, it worked, you should have the model and this file, both in your folder.

asmorkalov commented 4 years ago

DNN weighs are large and not stored in get repository. Please download them before the code execution. In case if you use Linux or Mac you can run getModels.sh script to do it automatically. Please download files manually with link in Readme.md, if you run code on Windows.