ultralytics / yolov5

YOLOv5 🚀 in PyTorch > ONNX > CoreML > TFLite
https://docs.ultralytics.com
GNU Affero General Public License v3.0
50.89k stars 16.38k forks source link

How can I convert best.pt to .weights file? #748

Closed qwe1997 closed 4 years ago

qwe1997 commented 4 years ago

❔Question

Additional context

I have to convert best.pt which is the weight file I trained to .weights file because of our company's project commands,so how can I convert best.pt file to .weights file?

github-actions[bot] commented 4 years ago

Hello @qwe1997, thank you for your interest in our work! Please visit our Custom Training Tutorial to get started, and see our Jupyter Notebook Open In Colab, Docker Image, and Google Cloud Quickstart Guide for example environments.

If this is a bug report, please provide screenshots and minimum viable code to reproduce your issue, otherwise we can not help you.

If this is a custom model or data training question, please note Ultralytics does not provide free personal support. As a leader in vision ML and AI, we do offer professional consulting, from simple expert advice up to delivery of fully customized, end-to-end production solutions for our clients, such as:

For more information please visit https://www.ultralytics.com.

glenn-jocher commented 4 years ago

Hello, thank you for your interest in our work! This issue seems to lack the minimum requirements for a proper response, or is insufficiently detailed for us to help you. Please note that most technical problems are due to:

If none of these apply to you, we suggest you close this issue and raise a new one using the Bug Report template, providing screenshots and minimum viable code to reproduce your issue. Thank you!

Requirements

Python 3.8 or later with all requirements.txt dependencies installed, including torch>=1.6. To install run:

$ pip install -r requirements.txt

Environments

YOLOv5 may be run in any of the following up-to-date verified environments (with all dependencies including CUDA/CUDNN, Python and PyTorch preinstalled):

Status

CI CPU testing

If this badge is green, all YOLOv5 GitHub Actions Continuous Integration (CI) tests are passing. These tests evaluate proper operation of basic YOLOv5 functionality, including training (train.py), testing (test.py), inference (detect.py) and export (export.py) on MacOS, Windows, and Ubuntu.

Frank1126lin commented 4 years ago

@qwe1997 @glenn-jocher I believe s/he want to deploy the weight file in the yolov4, thus in the darknet fromat. I remember that ONNX can do such a thing , maybe you can have a try.

github-actions[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

aryaafshar commented 5 months ago

I work on the same project \i found somethin please see https://github.com/wang-xinyu/tensorrtx/blob/master/yolov5/gen_wts.py

glenn-jocher commented 5 months ago

Hello! It looks like you're pointing to a script that can help convert YOLOv5 models to a format compatible with TensorRT. This is useful for deploying on platforms that support TensorRT optimization. Just ensure that any external scripts or tools you use comply with the licensing and compatibility requirements of your project. If you need further guidance on model conversion or deployment, feel free to check out our official documentation at https://docs.ultralytics.com/yolov5/tutorials/model_export/. Happy coding! 😊