Comments (3)
@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.
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.
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)
- Error converting mistral to onnx HOT 13
- SparseML/YOLOv5s - ValueError: Unable to find any modifiers in given recipe. HOT 1
- Feature Request: Oriented Bounding Box Sparsification for YOLOv5/YOLOv8 on Custom Models/Datasets HOT 1
- [Roadmap] SparseML Roadmap Q1 2024 HOT 1
- Regarding the execution speed and model size after Sparsifying ResNet-50 HOT 2
- Class Index change observed when validating a yolov5 pruned sparseml model HOT 2
- yolov5 sparse fine tuning error HOT 2
- [Roadmap] SparseML Roadmap Q2 2024
- Does Sparseml support Integer-Arithmetic-Only Inference? HOT 1
- recipe.yaml not found HOT 4
- Missing key(s) in state_dict: "model.0.conv.quant.activation_post_process.scale" HOT 5
- Performance Degradation in YOLOv8s Model Exported to ONNX via SparseML's Exporter HOT 9
- How to export a GPTQ model to ONNX to run in DeepSparse HOT 2
- Sparsify custom pytorch models from scratch HOT 8
- Remove QuantizeLinear/DequantizeLinear of ONNX model HOT 5
- Sparse/Quantization Aware Training for YOLOv10 HOT 4
- YOLOv8 - INT4 Training HOT 1
- YOLOv8 Export Bug HOT 2
- One-Shot LLM Compression bug with obcq recipe.yaml HOT 2
- How to yolov9 dynamic pruning? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sparseml.