Giter Site home page Giter Site logo

Comments (5)

gpleiss avatar gpleiss commented on May 28, 2024

The "size mismatch" error looks like its coming from the final classification layer. Did you set the num_classes option to be the correct number of classes?

from efficient_densenet_pytorch.

chmaz avatar chmaz commented on May 28, 2024

Hi,

Yes, I have set the num_classes. I managed to have a training working with my images and resnet (adapting the resnet to the size of my images as described in pytorch/vision#155).
So my guess is that I get this error due to the custom size (80 x 80 pixels) of my images and I don't know how to adapt the densenet model for this image size.

I will keep looking,

Thanks,

Christophe

from efficient_densenet_pytorch.

gpleiss avatar gpleiss commented on May 28, 2024

My other guess is that its a pooling issue. The default settings (3 pooling blocks) will reduce a 32x32 image into 1x1 feature maps by the last layer. An 80x80 image might instead be reduced to 3x3 feature maps, which cannot directly be fed into the classifier without further pooling (or increasing the size of the layer).

from efficient_densenet_pytorch.

chmaz avatar chmaz commented on May 28, 2024

By trying different values, I found that setting the avgpool_size to 10 solves the problem.

Thanks for the assistance,

Christophe

from efficient_densenet_pytorch.

taineleau-zz avatar taineleau-zz commented on May 28, 2024

@chmaz Hi, I haven't seen this issue until now.

If you are going to test different size of images, I would recommend you using AdaptiveAvgPool2d or AdaptiveMaxPool2d instead of manually setting up the avgpooling size. I guess this would be much more convenient for you. :D

from efficient_densenet_pytorch.

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.