Code Monkey home page Code Monkey logo

yolov8-pytorch_quantization's Introduction

yolov8-pytorch_quantization

1、使用pytorch_quantization对yolov8进行量化,ptq、敏感层分析、qat。主要参考知识星球里  
《集智书童》的yolov5量化,该星球干货满满,有兴趣的同学可以关注《集智书童》。

安装yolov8

pip install ultralytics
注释ultralytics源码ops.py:262一下内容,避免推理超时break,导致验证值存在波动、不准确问题。
    if (time.time() - t) > time_limit:
        LOGGER.warning(f'WARNING ⚠️ NMS time limit {time_limit:.3f}s exceeded')
        break  # time limit exceeded

运行

自行修改ptq、qat、敏感层分析配置参数后直接运行。
python yolov8_ptq_int8.py

运行结果

            Class     Images  Instances    Box(P          R      mAP50    mAP50-95
未量化      all        128        929       0.64      0.537      0.605      0.446
ptq         all        128        929      0.721      0.487      0.596      0.432
跳过铭感层   all        128        929      0.676       0.51      0.606      0.435

后续完善内容

1、增加每一层输出的相似度。
2、铭感层分析更加细化,当前仅对 yolo.model.model[i]进行分析。

yolov8-pytorch_quantization's People

Contributors

zongmouhuang avatar huangzongmou avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.