-
Notifications
You must be signed in to change notification settings - Fork 128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to convert the weights to caffemodel? #15
Comments
Luckly,My workmate and I found the reason. The .weights you have download is not right, by the way, which means the .weights you have download can not match the .prototxt . You can download the old yolov2's weight here——https://drive.google.com/drive/folders/0B1tW_VtY7onidEwyQ2FtQVplWEU |
Hi, I have the same issue when I try to convert the weights using the prototxt provided in indoor/convert/ and the weights provided in the yolo v2 webpage https://pjreddie.com/darknet/yolov2/. When I run the script the following error shows up: Traceback (most recent call last): Can someone when help me! @JingliangGao I've tried with your weights but still have the same error. |
The yolo.protext is a wrong, please use the following text and instead of yolo.protext: layer{ layer{ layer{ layer{ layer{ layer{ layer{ layer{ layer{ layer{ layer{ layer{ layer{ layer{ layer{ layer{ layer{ layer{ } layer { layer{ } layer { layer { layer{ layer { |
@djiayong5 Could you please tell me which weights is attached to the prototxt you gave? |
The prototxt file I have use is the following: PD: I have used the YOLO v2 608x608 coco weights provided in the preddie page. name: "YOLONET" layer { layer{ layer{ layer{ layer{ layer{ layer{ layer{ layer{ layer{ layer{ layer{ layer{ layer{ layer{ layer{ layer{ layer{ layer{ } layer { layer { layer { layer { layer { layer{ layer { |
yolo官网的cfg和这里的prototxt不同。 |
Thanks for your share.I meet a problem when I try to convert the weights to caffemodel.
python convert_weights_to_caffemodel.py yolo.prototxt yolo.weights yolo.caffemodel
the yolo.prototxt is provided by you,and the yolo.caffemodel(yolov2) is downloaded from https://github.com/AlexeyAB/darknet ,when I run the program,I got the error:
conv20(conv)
bn20(batchnorm)
scale20(scale)
conv21(conv)
Traceback (most recent call last):
File "convert_weights_to_caffemodel.py", line 70, in
net.params[pr][0].data[...] = np.reshape(netWeights[count:count + weightSize], dims)
File "/home/zcy/.local/lib/python2.7/site-packages/numpy/core/fromnumeric.py", line 232, in reshape
return _wrapfunc(a, 'reshape', newshape, order=order)
File "/home/zcy/.local/lib/python2.7/site-packages/numpy/core/fromnumeric.py", line 57, in _wrapfunc
return getattr(obj, method)(*args, **kwds)
ValueError: cannot reshape array of size 12265129 into shape (1024,3072,3,3)
I dont know why this happened?
The text was updated successfully, but these errors were encountered: