Skip to content
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 use jupyter Notebook to run the script? #1

Open
uestchang opened this issue Jul 2, 2021 · 5 comments
Open

How to use jupyter Notebook to run the script? #1

uestchang opened this issue Jul 2, 2021 · 5 comments

Comments

@uestchang
Copy link

Hello, I am trying to convert yolov5 model.yaml and weight.pt to .cfg and .weights, I found your excellent work here, and finished the steps of project Readme, but I konw nothing about jupyter script, could you help me?

@uestchang
Copy link
Author

I see the script that can convert the yolov5x.cfg and yolov5x.pt to yolov5.yaml and yolov5.weights, can this script convert the other yolov5 pytorch model to darknet model?

@uestchang
Copy link
Author

Try to use the converted model on opencv and get a error: cv2.error: OpenCV(4.5.2) /tmp/pip-req-build-13uokl4r/opencv/modules/dnn/src/darknet/darknet_io.cpp:900: error: (-212:Parsing error) Unknown layer type: Focus in function 'ReadDarknetFromCfgStream'

@adrianosantospb
Copy link
Owner

Hello, I am trying to convert yolov5 model.yaml and weight.pt to .cfg and .weights, I found your excellent work here, and finished the steps of project Readme, but I konw nothing about jupyter script, could you help me?

For sure I will :)

@adrianosantospb
Copy link
Owner

I see the script that can convert the yolov5x.cfg and yolov5x.pt to yolov5.yaml and yolov5.weights, can this script convert the other yolov5 pytorch model to darknet model?

I added this script (https://github.com/adrianosantospb/yolov5_ultralytics_to_darnet_format/blob/master/yolov5_ultralytics_to_darknet.py). You can use it if you want.

@adrianosantospb
Copy link
Owner

adrianosantospb commented Jul 6, 2021

Try to use the converted model on opencv and get a error: cv2.error: OpenCV(4.5.2) /tmp/pip-req-build-13uokl4r/opencv/modules/dnn/src/darknet/darknet_io.cpp:900: error: (-212:Parsing error) Unknown layer type: Focus in function 'ReadDarknetFromCfgStream'

You need to install the opencv-contrib-python library (pip install opencv-contrib-python). I don't know if you installed the dependencies libraries, but you have to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants