Giter VIP home page Giter VIP logo

Comments (8)

prlz77 avatar prlz77 commented on July 23, 2024

This model is made for CIFAR, which is (3, 32, 32), so the last avg pooling operation will not coincide for bigger input. You can just change it for .mean(-1).mean(-1). It will do the same as average pooling but without complaining about the image size.

from resnext.pytorch.

yuzehui1996 avatar yuzehui1996 commented on July 23, 2024

I can't get the point you say. Could you please explian it?
x = self.conv_1_3x3.forward(x)
x = F.relu(self.bn_1.forward(x), inplace=True)
x = self.stage_1.forward(x)
x = self.stage_2.forward(x)
x = self.stage_3.forward(x)
x = F.avg_pool2d(x, 8, 1)
x = x.view(-1, self.stages[3])
return self.classifier(x)

Do you mean the 'F.avg_pool2d(x,8,1)' ???

from resnext.pytorch.

prlz77 avatar prlz77 commented on July 23, 2024

Yes! Just change it by x.mean(3).mean(2)

from resnext.pytorch.

yuzehui1996 avatar yuzehui1996 commented on July 23, 2024

I replace the avg_pool with 'x=x.mean(-1).mean(-1)', but it doesn't work. Did I misunderstand your suggestion? BTW, the error shows that "cuda out of memory", and it shows the error in the stage_1.forward.

from resnext.pytorch.

prlz77 avatar prlz77 commented on July 23, 2024

Well, that's another matter. Can you try with batch_size = 1?

from resnext.pytorch.

yuzehui1996 avatar yuzehui1996 commented on July 23, 2024

It sill doesn't work!
the error is :
ValueError: Expected input batch_size (441) to match target batch_size (1).

from resnext.pytorch.

yuzehui1996 avatar yuzehui1996 commented on July 23, 2024

And I resize the img to (3,32,32) and it works.

from resnext.pytorch.

prlz77 avatar prlz77 commented on July 23, 2024

If you do:

model(image)
where image is of size (1, 3, 112, 112), it should work.

from resnext.pytorch.

Related Issues (18)

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.