Giter VIP home page Giter VIP logo

Comments (6)

Eric-mingjie avatar Eric-mingjie commented on May 26, 2024

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.

fanbinqi avatar fanbinqi commented on May 26, 2024

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.

Eric-mingjie avatar Eric-mingjie commented on May 26, 2024

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.

nepulhl avatar nepulhl commented on May 26, 2024

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.

Eric-mingjie avatar Eric-mingjie commented on May 26, 2024

@nepulhl are you using Pytorch 0.3.1? Our code is developed based on Pytorch version 0.3.1.

from network-slimming.

nepulhl avatar nepulhl commented on May 26, 2024

@Eric-mingjie Thank you,I have sloved the problem by updating Pytorch.

from network-slimming.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.