-
Notifications
You must be signed in to change notification settings - Fork 334
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
Can it convert yolo's version 2 (.weights) files to caffemodel files? #15
Comments
This should be doable, but I think there are some layers that are not supported by caffe, e.g., [route] and [reorg]. You may need to dig into yolo source code and try to implement these layers in caffe. Currently, I don't have free hands to do this. You are welcome to contribute. |
The author of YOLO v2 says, route + reorg only adds 1% improvement. |
Hi, |
Hey, In order to use YOLOv2 on caffe, However, that layer is not simple. Unfortunately, I gave up on half way. Cuz right now working on another project and really enjoying using YOLO for my projects. |
you have to compile the released version in: 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 { #http://ethereon.github.io/netscope/#/gist/9640ecb59a75f230446e7c70d2f8bcf3 |
@SHaiHosh Hi, thanks for your prototxt! Using the script that project provides it can convert yolo-voc.weights to caffemodel, I'll try to make it work for yolo.prototxt accordingly. BTW have you tried to train yolo2 on Caffe on that project? Does it work fine or not? |
Yes it works |
@SHaiHosh Thanks! I'll try it. |
@SHaiHosh Hi, SHaiHosh. After normalization , have you test the yolov2 of caffe version on any benchmark datasets? How dose it work? |
yes i have tested the yolov2 caffe version |
Regionlayer is re-implemented in this repo in c/c++, along with a python wrapper. Have fun! |
@SHaiHosh I can convert yolo-voc.weights by the prototxt you shared, thanks. |
Convert darknet yolov2 model to caffe · Issue #24 · ysh329/deep-learning-model-convertor |
@SHaiHosh Thank you for the prototxt, I was able to create the caffemodel using it. Thereafter I modified the test_yolo_v2.py to point to your prototxt and the caffemodel and tried running it. But i am now getting a segmentation fault. Did the script run for you? |
which GPU do you have? |
@SHaiHosh I using a CPU only system. Interestingly i tried the train_lenet.sh script and it also met with a core dump. Do you have any idea what might be happening? |
that error occurs because your prototxt doesn't have biases or you get the result before detection output such as conv22. @SHaiHosh I could run test_yolo_v2.py and test_out_put/test_eval.py with converted model. In test_out_put/test_eval.py, it just interpret the detection results. But in all cases, I failed to get the correct bboxs(too many boxes with just spread over the image). but actually in case of the darknet's yolov2(coco-608x608), the min/max values of the outputs of net->predict() are MIN : -2.505956 MAX : 2.043313. This proves the converted model works totally wrongly. I will keep trace the reason for this wrong result of darknet yolov2... Did you use your own code? or just modified those code? your hint must be really helpful and save my time aaaa looooot. Thank you very much!! |
I found a bug in this repo regarding scale/bias for conv21. I'm trying to fix it. but after fixing it manually(hardcode some values), I coudn't get the good detection results even though better than before(that was really terrible....). I'm seeing a light more and more..... I really wonder how other guys can successfully run this repo withought modification;;;; there are many bugs that must occur to everyone! |
well, test_yolo_v2.py works finally well but little bit slower than original darknet-yolov2. but with caffe, I can extend yolov2 with other DCNN's much more and optimize more easily! so it's wonderful. after NMS |
Hi: |
@dedoogong How did you solve the problem that the Net detected too many boxes? |
Finally,I have solved the problem, In the Protofile provided by @SHaiHosh,Firstly,I found a bug that theres is no scale_layer followed the layer "bn21", I added a scale layer and relu layer,;Secondly, the last layer conv23 should not be followed by a relu layer;When you fixed these two bug, use the new protofile to get the yolo.caffemodel by the yolo-voc.weight, then you can use the yolo.caffemodel to do some test, this is my result |
@ChriswooTalent Could you share your fixed version of the prototxt file? |
@HammadJ Now, I am sorting my code and file, and I will share them on my github this week! |
@ChriswooTalent / @dedoogong it would be nice if you could share the code for those of us who'd just like to try it out. Thanks in advance!! |
@ChriswooTalent /@dedoogong , I am trying caffe-yolov2 and not been successful.
Fix: Using darknet2Caffe.py (https://github.com/marvis/pytorch-caffe-darknet-convert) I got converted prototxt and caffemodel. name: "yolov2" layer { layer { Appreciate any guidance on this. |
@SHaiHosh I tried your prototxt. But there is still a mistake. Do you know what's wrong? |
@imbadh : Can you please let me know on how did you fix the issue of Update: I was trying to convert yolov2-voc.weights which was giving the error. When I used http://pjreddie.com/media/files/yolo-voc.weightshttp://pjreddie.com/media/files/yolo-voc.weights. Conversion worked okay |
@appusom May you please let me know how did you resolve the issue of
When I did backtrace it seems to crash in get_region_boxes function I believe |
Now there is Yolo v2 by link: http://pjreddie.com/darknet/yolo/
And old Yolo v1 is here: http://pjreddie.com/darknet/yolov1/
Can the caffe-yolo convert yolo's version 2 (.weights) files to caffemodel files by using create_yolo_caffemodel.py?
Or will it possible later?
The text was updated successfully, but these errors were encountered: