Comments (6)
Could you share more details about the fault? For example, the traceback of the fault. It would be more helpful for us to look into your problem.
from network-slimming.
first i run python main.py --dataset cifar10 --arch vgg --depth 19, and then python main.py -sr --s 0.0001 --dataset cifar10 --arch vgg --depth 19
i got two file, checkpoint.pth.tar and model_best.pth.tar.
run python vggprune.py, i set check.pth.tar is the model path and get :
=> loading checkpoint './logs/checkpoint.pth.tar'
Traceback (most recent call last):
File "vggprune.py", line 43, in
model.load_state_dict(checkpoint['state_dict'])
File "/usr/local/lib/python3.5/dist-packages/torch/nn/modules/module.py", line 522, in load_state_dict
.format(name))
KeyError: 'unexpected key "module.feature.0.weight" in state_dict'
from network-slimming.
I try the code myself. There is not any problem with the code itself.
I think the problem is that the format of checkpoint.pth.tar
and variable model
is not the same. One of them is a DataParrell object. Please make sure they conform to the same object type.
from network-slimming.
Thanks for your nice sharing!
there is a fault when i run the file of vggprune.py.
Traceback (most recent call last):
File "vggprune.py", line 142, in
m1.weight.data = m0.weight.data[idx1.tolist()].clone()
TypeError: indexing a tensor with an object of type list. The only supported types are integers, slices, numpy scalars and torch.cuda.LongTensor or torch.cuda.ByteTensor as the only argument.
from network-slimming.
@nepulhl are you using Pytorch 0.3.1? Our code is developed based on Pytorch version 0.3.1.
from network-slimming.
@Eric-mingjie Thank you,I have sloved the problem by updating Pytorch.
from network-slimming.
Related Issues (20)
- resnet50 HOT 1
- 为什么定义的resnet网络训练时gpu显存占用这么大啊?
- 为什么我裁剪完成后,模型运行占用的显存比没裁剪的还要高? HOT 1
- 预测单张照片时,准确率只有0.0几 HOT 2
- Minor Bugs caused by old version
- Sparse Confusion HOT 1
- channel_selection layer intraining process HOT 2
- 剪枝后保存的权重文件和newmodel加载不上 HOT 3
- RuntimeError: Given groups=1, weight of size [15, 14, 1, 1], expected input[64, 16, 32, 32] to have 14 channels, but got 16 channels instead HOT 1
- If the remaining channel for a layer is zero, it reports zero division error HOT 2
- 原论文中的memory是指 HOT 6
- TypeError: item() takes no arguments (1 given) HOT 1
- mnn加载剪枝模型错误 HOT 1
- 经稀疏训练剪枝后模型变小,但是refine微调后模型又变大了
- 关于L1 regular HOT 1
- m.weight.grad.data.add_的问题
- 问题咨询:剪枝后通道数为0 HOT 7
- RuntimeError: CUDA error: device-side assert triggered HOT 1
- About other visions
- 题外话:模型压缩如何入门?对于自己的网络架构该如何着手去写剪枝代码?
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 network-slimming.