GithubHelp home page GithubHelp logo

Comments (3)

markurtz avatar markurtz commented on August 20, 2024 1

@pumetu for the second question, we should be able to inject this SparseML sample code right after the creation of the optimizer here to enable recipes: https://github.com/ZQPei/deep_sort_pytorch/blob/master/deep_sort/deep/train.py#L68

from sparseml.pytorch.optim import ScheduledModifierManager

manager = ScheduledModifierManager.from_yaml(RECIPE_PATH)
optimizer = manager.modify(model, optimizer, steps_per_epoch=len(train_loader))

This will enable using the recipes for the training flows.

from sparseml.

pumetu avatar pumetu commented on August 20, 2024

I'm also trying to quantize a library called DeepSort, would you have any suggestions or resources I could look at to quantize it?
https://github.com/ZQPei/deep_sort_pytorch#training-the-re-id-model

from sparseml.

markurtz avatar markurtz commented on August 20, 2024

Hi @pumetu, definitely. Here are some short configs for YOLOv5L that haven't been heavily optimized for performance but should get you started in the right direction. Note, for any of the other v5 variants you'll need to adjust the params listed out in the quantization modules to add or subtract appropriately.

Quantization only, run with the fine tuning hyp:

version: 1.1.0
modifiers:
  - !EpochRangeModifier
    start_epoch: 0.0
    end_epoch: 3

  - !SetLearningRateModifier
    start_epoch: 0
    learning_rate: 0.0001

  - !SetLearningRateModifier
    start_epoch: 1
    learning_rate: 0.0032

  - !QuantizationModifier
    start_epoch: 1
    submodules:
      - model.0
      - model.1
      - model.2
      - model.3
      - model.4
      - model.5
      - model.6
      - model.7
      - model.8
      - model.9
      - model.10
      - model.11
      - model.12
      - model.13
      - model.14
      - model.15
      - model.16
      - model.17
      - model.18
      - model.19
      - model.20
      - model.21
      - model.22
      - model.23

Pruning only, run with the from scratch hyp:

version: 1.1.0
modifiers:
  - !EpochRangeModifier
    start_epoch: 0.0
    end_epoch: 240.0
  - !GMPruningModifier
    params: __ALL_PRUNABLE__
    init_sparsity: 0.25
    final_sparsity: 0.90
    update_frequency: 2.0
    start_epoch: 5.0
    end_epoch: 65.0

from sparseml.

Related Issues (20)

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.