Comments (6)
Thanks for reaching out. The error looks like your torch version is not supported. Could you provide the torch version?
from only_train_once.
Thank you for your reply. The version I use is torch1.12.1, onnx1.15.0, only_train_once3.0.0. Also I would like to ask how mark_unprunable_by_node_ids is determined, and if don't add the mark_unprunable_by_node_ids parameter, will it have any effect?
from only_train_once.
torch==1.12
is not supported by OTO. We recommend to upgrade torch>=2.0
.
Marking node groups as unprunable is to skip unsupported pattern and focuses on pruning over the remaining sub-graphs. For Yolov5, the skipped node-groups could be found at yolo_v5. Different torch version may have varying node-ids, thereby may need to some adjustments. Ideally and typically, there is no need to manually set up such stuffs. The principle for setup is to write a sanity check over a DNN. During sanity check, if there exists some error happening during sub-network validation, mark the node groups corresponding to where the errors came from is a common routine to mark unprunable.
Meanwhile, the potential efforts of setting up unprunable node groups could be gradually relieved following the further developments and evolutions of pruning dependency graph. Current graph analysis in both OTO and torch-pruning still have room for advanced automation.
from only_train_once.
thanks, it works. I have tried torch-pruning before, but the results are not rational, for yolov5 pruning 30% accuracy degradation will be more serious, have you tried to compare OTO and torch-pruning on yolov5?
from only_train_once.
@jiao1234567 Glad to hear it works.
For accuracy, I assume that you used the optimizer setup presented in the tutorial for resnet18 cifar10. I would say you may want to try fine-tune the hyperparameters to make it competitive. We recommend to set up the hyperparameters to be exactly the same as the baseline optimizer. Meanwhile, some experiments need to enlarge training steps for convergence.
I personally did not try Yolov5 due to limited bandwidth, yet one of my colleagues tried OTO on YOLO over COCO. Actually target-group-sparsity as 0.3 if that is the pruning ratio you used should not have significant acc degradation based on his experience if training pipeline is properly setup. My colleague's personal suggestion is to double check the first_momentum
setup, which default value of SGD
is 0, yet recommended set as 0.9
for COCO. See the below table and curve.
from only_train_once.
Closed as the topic has been completed. Feel free to open a new issue regarding accuracy if still have regression. Our official tutorial on yolo will be released on the early of next year along with the release of HESSO optimizer technical report. A tutorial README is uploaded here.
from only_train_once.
Related Issues (20)
- When quantizing the YOLOv8 model and calling the code optimizer = oto.dhspg(), an error is thrown. HOT 2
- Grouped Conv compress ERROR HOT 13
- Meaning of omega in compute_group_sparsity_omega( ) HOT 1
- Get pytorch model prune shape HOT 1
- Problem omega decrease, but group_sparsity not increase HOT 5
- Wrong train use DDP HOT 9
- When I replaced the model in the tutorial with my own other model, this error occurred HOT 3
- How to reproduce the experiment results on Squad in OTOV2? HOT 1
- Error in Concat-Split HOT 5
- How to load compressed model ? HOT 1
- Confused about Fig 3a in OTO v1 paper HOT 3
- pruning transformer-based model HOT 2
- Understanding pruning_steps HOT 1
- Allowing dummy_input to be tuple / dict HOT 1
- Models with no ZIG? HOT 19
- HESSO optimizer technical report HOT 2
- Can not prune YOLOv8 model HOT 2
- Prune vision transformer HOT 2
- Is it normal to have different test results on same model and data? HOT 2
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 only_train_once.