Coder Social home page Coder Social logo

Comments (4)

gwding avatar gwding commented on August 15, 2024

@soheilb could you paste the error message here? and which lines you were making changes?

from theano_alexnet.

soheilb avatar soheilb commented on August 15, 2024

My changes are in the lines 37 and 45 of the alex_net.py file where I changed 227 to 224 (to make it exactly equal to the alexnet paper). Then I used the config file to select between cudnn and cuda-convnet (lib_conv flag). The error seems to be relevant to the size of the input for the first fully connected layer. Apparently using cudnn, the input size of the first fully connected layer changes to 6400 (256 times 25) while it is supposed to have dimension 9216 (256 times 36). Here is the error:

ValueError: dimension mismatch in args to gemm (256,6400)x(9216,4096)->(256,4096)
Apply node that caused the error: GpuDot22(GpuFlatten{2}.0, <CudaNdarrayType(float32, matrix)>)
Toposort index: 314
Inputs types: [CudaNdarrayType(float32, matrix), CudaNdarrayType(float32, matrix)]
Inputs shapes: [(256, 6400), (9216, 4096)]
Inputs strides: [(6400, 1), (4096, 1)]
Inputs values: ['not shown', 'not shown']
Outputs clients: [[GpuElemwise{Add}[(0, 0)](GpuDot22.0, GpuDimShuffle{x,0}.0)]]

from theano_alexnet.

gwding avatar gwding commented on August 15, 2024

@soheilb I would suggest looking at the padding size settings around
https://github.com/uoguelph-mlrg/theano_alexnet/blob/master/lib/layers.py#L172
There might be some subtle difference between the cudnn library and cudaconvnet, on how to use those settings.
Sorry that I personally don't have easy access on machines that can run these things, so couldn't try it myself.

from theano_alexnet.

soheilb avatar soheilb commented on August 15, 2024

Yes, it seems the difference is in how they handle the padding. Thanks for looking into this.

from theano_alexnet.

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.