GithubHelp home page GithubHelp logo

Comments (6)

fmassa avatar fmassa commented on May 28, 2024

@xonobo can't you just take your input and do

input=input:view(1,input:size(1),input:size(2),input:size(3))

before feeding the input to the network ?

from cudnn.torch.

mys007 avatar mys007 commented on May 28, 2024

Some time ago I observed that cudnn doesn't like 0-strides, I think this is the case. fmassa's solution should work.

from cudnn.torch.

xonobo avatar xonobo commented on May 28, 2024

I tried this but now gives an assertion fail

m:forward(torch.rand(1,7,7):view(1,1,7,7):cuda())
/torch/install/share/lua/5.1/cudnn/SpatialConvolution.lua:92: assertion failed!
stack traceback:
[C]: in function 'assert'
/torch/install/share/lua/5.1/cudnn/SpatialConvolution.lua:92: in function 'createIODescriptors'
/torch/install/share/lua/5.1/cudnn/SpatialConvolution.lua:339: in function 'updateOutput'
/torch/install/share/lua/5.1/nn/Sequential.lua:44: in function 'forward'
[string "_RESULT={m:forward(torch.rand(1,7,7):view(1,1..."]:1: in main chunk
[C]: in function 'xpcall'
/torch/install/share/lua/5.1/trepl/init.lua:650: in function 'repl'
/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:199: in main chunk

By the way I want to handle this dummy resizing in the model. Since the input sizes of the images may vary I could not use nn.View.

from cudnn.torch.

fmassa avatar fmassa commented on May 28, 2024

@xonobo remove the nn.Replicate from your network.
Also, no need to use the nn.View module, apply the view directly to the input data, this way it's independent on the input size

from cudnn.torch.

xonobo avatar xonobo commented on May 28, 2024

ok forgot to remove the replicate. Now it works.

Thanks for the solution. This is not what I exactly want but handle the resizing of input before feeding to the model.

from cudnn.torch.

fmassa avatar fmassa commented on May 28, 2024

if you absolutely want to have the nn.Replicate(1) in your network, add also just after it a nn.Copy(nil,nil,true), and then you can feed the input without viewing it. But it won't handle the case where the input is already batched.

from cudnn.torch.

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.