Comments (3)
have you solove this question? i had met same problem
from torch-pruning.
have you solove this question? i had met same problem
@luoshiyong Not yet. How did you saved your model ?
from torch-pruning.
Hi,
I managed to use the example demo of Yolov8.
Then I'm able to load and run the pruned model by using :
from ultralytics.nn.tasks import attempt_load_one_weight
model, _ = attempt_load_one_weight(weights)
But for that I need to import the C2f_v2 class as it's not part of ultralytics YOLOV8 :
class C2f_v2(nn.Module):
# CSP Bottleneck with 2 convolutions
def init(self, c1, c2, n=1, shortcut=False, g=1, e=0.5): # ch_in, ch_out, number, shortcut, groups, expansion
super().init()
self.c = int(c2 * e) # hidden channels
self.cv0 = Conv(c1, self.c, 1, 1)
self.cv1 = Conv(c1, self.c, 1, 1)
self.cv2 = Conv((2 + n) * self.c, c2, 1) # optional act=FReLU(c2)
self.m = nn.ModuleList(Bottleneck(self.c, self.c, shortcut, g, k=((3, 3), (3, 3)), e=1.0) for _ in range(n))
def forward(self, x):
# y = list(self.cv1(x).chunk(2, 1))
y = [self.cv0(x), self.cv1(x)]
y.extend(m(y[-1]) for m in self.m)
return self.cv2(torch.cat(y, 1))
Hope it will help!
from torch-pruning.
Related Issues (20)
- AttributeError: Can't get attribute '__main__' on <module 'builtins' (built-in)>
- Error when pruning a group with GLU Layer HOT 4
- Improve Iterative Pruning: Verify Pruning Status Before Training HOT 1
- The QRcode of WeChat group has expired, could anyone please share a new one? HOT 1
- Yolov8 upgrade ultralytics version HOT 2
- Cannot calculate importance score for a single group HOT 1
- What is 'N' in "Iˆ = N · I / P{TopN(I )}" HOT 1
- Yolov8 pruning with Taylor criteria
- Add hooks to a module (make sure the hooks are removed), cannot deepcopy OBB model HOT 1
- How to make tracer account for arbitrary restrictions such as making a particular dim divisible by 4? HOT 1
- Hi i have already sparsity the gamma of layerNorm in Segformer. Can I use the methode to prune the model ?
- Clarification around MetaPruner
- How can I get the mask of the pruned model when I apply the soft pruning?
- loss stop reducing after pruning.
- Can the process of structural pruning be rolled back?
- The parameters and computation decreased, but FPS was worse than the baseline model HOT 2
- AttributeError: partially initialized module 'torch_pruning' has no attribute 'DependencyGraph' HOT 1
- Yolov10 Pruning HOT 3
- Fine-Tuning a U-Net trained using MONAI lib
- 微信群 HOT 6
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 torch-pruning.