Comments (3)
Hello @BuKeMod ,
Consider verifying if you have altered the '--gradsize' parameter. The default setting for 'gradsize' is 1000. It's important to ensure that the 'gradsize' value is less than the 'trainsize'.
Thanks.
from slimsam.
I've encountered a new issue. Do you have any examples of training, such as using Colab or Kaggle? I'm a beginner and don't quite understand yet. Thank you.
CUDA visible devices: 1
CUDA Device Name: Tesla P100-PCIE-16GB
===========================Parameter Settings===========================
Pruning Ratio: 0.3
VIT num_heads: 12
norm_type: mean
imptype: Disturb
global: False
learning rate: 0.0001
a_weight: 0.5
round_to 12
TRAIN_SIZE 40 VAL_SIZE 12 GRAD_SIZE 0 Epochs 5
===========================Pruning Start===========================
/kaggle/working/SlimSAM/torch_pruning/dependency.py:639: UserWarning: Unwrapped parameters detected: ['pos_embed', 'neck.3.bias', 'neck.3.weight', 'neck.1.bias', 'neck.1.weight'].
Torch-Pruning will prune the last non-singleton dimension of a parameter. If you wish to customize this behavior, please provide an unwrapped_parameters argument.
warnings.warn(warning_str)
Traceback (most recent call last):
File "/kaggle/working/SlimSAM/prune_distill_step1.py", line 295, in
train_model()
File "/kaggle/working/SlimSAM/prune_distill_step1.py", line 136, in train_model
model.image_encoder = prune_sam_step1(model=model.image_encoder, example_inputs=example_inputs, model_name=model_name, round_to=round_to, ratio=ratio, imptype = imptype, norm_type=norm_type, global_way=global_way)
File "/kaggle/working/SlimSAM/prune_funcs.py", line 140, in prune_sam_step1
pruner.step()
File "/kaggle/working/SlimSAM/torch_pruning/pruner/algorithms/metapruner.py", line 162, in step
for group in pruning_fn():
File "/kaggle/working/SlimSAM/torch_pruning/pruner/algorithms/metapruner.py", line 212, in prune_local
imp = self.estimate_importance(group, ch_groups=ch_groups)
File "/kaggle/working/SlimSAM/torch_pruning/pruner/algorithms/metapruner.py", line 166, in estimate_importance
return self.importance(group, ch_groups=ch_groups)
File "/kaggle/working/SlimSAM/torch_pruning/pruner/importance.py", line 426, in call
dw = layer.weight.grad.data[idxs].flatten(1)
AttributeError: 'NoneType' object has no attribute 'data'
from slimsam.
Please ensure that the 'gradsize' parameter is set to a value greater than 0. The importance estimation algorithm relies on gradient information for each parameter, making it essential that 'gradsize' is not zero. Note that while 'gradsize' should be less than 'trainsize', a larger 'gradsize' can be more effective for pruning purposes.
Thanks!
from slimsam.
Related Issues (18)
- AttributeError: 'GELU' object has no attribute 'approximate' HOT 2
- Is SlimSAM compatible with SAM? HOT 5
- Nice Work ! Could you provide the configuration about the SA-1B dataset? HOT 5
- SlimSAM in transformers.js HOT 3
- License HOT 1
- Import SAMModel,SAMProcessor from hugging face HOT 2
- Question about del_pos_init and get_pos_init HOT 1
- Low IOU when trained with self captured data. HOT 10
- Prune ratios for each step HOT 2
- How long did the project take to train? HOT 2
- Batch Prompting for Multiple Boxes HOT 15
- evaluate algorithms such as SAM, EfficientSAM, etc. HOT 2
- Questions about multi-GPU training HOT 2
- Questions about Conversion of torch model to tensorRT model HOT 1
- The MACs result doesn't contain q@k and attn@V HOT 1
- How to use SlimSAM to segment everything and provide bbox? HOT 3
- AttributeError: 'DataParallel' object has no attribute 'img_size' 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 slimsam.