cuDNN error: CUDNN_STATUS_BAD_PARAM.Can someone explain why i am getting this error and how can i correct it?How to verify CuDNN installation?multi-variable linear regression with pytorchCUDNN Error in backprop for big batchesCUDNN error using pretrained vgg16 modelAttributeError: 'builtin_function_or_method' object has no attribute 'requires_grad'Implementing a custom dataset with PyTorchcupy.cuda.cudnn.CuDNNError: CUDNN_STATUS_INTERNAL_ERRORType Conversionssize mismatch, m1: [3584 x 28], m2: [784 x 128] at /pytorch/aten/src/TH/generic/THTensorMath.cpp:940PyTorch why does the forward function run multiple times and can I change the input shape?

Is there an Impartial Brexit Deal comparison site?

Are there any comparative studies done between Ashtavakra Gita and Buddhim?

Efficiently merge handle parallel feature branches in SFDX

Teaching indefinite integrals that require special-casing

Will it be accepted, if there is no ''Main Character" stereotype?

Products and sum of cubes in Fibonacci

Why did Kant, Hegel, and Adorno leave some words and phrases in the Greek alphabet?

Is there a good way to store credentials outside of a password manager?

Using parameter substitution on a Bash array

What is the term when two people sing in harmony, but they aren't singing the same notes?

What is the oldest known work of fiction?

Is there a problem with hiding "forgot password" until it's needed?

What's the purpose of "true" in bash "if sudo true; then"

Where in the Bible does the greeting ("Dominus Vobiscum") used at Mass come from?

Coordinate position not precise

Bash method for viewing beginning and end of file

How do I keep an essay about "feeling flat" from feeling flat?

Is there any reason not to eat food that's been dropped on the surface of the moon?

How does it work when somebody invests in my business?

Is it okay / does it make sense for another player to join a running game of Munchkin?

Can a monster with multiattack use this ability if they are missing a limb?

What will be the benefits of Brexit?

Your magic is very sketchy

Why is delta-v is the most useful quantity for planning space travel?



cuDNN error: CUDNN_STATUS_BAD_PARAM.Can someone explain why i am getting this error and how can i correct it?


How to verify CuDNN installation?multi-variable linear regression with pytorchCUDNN Error in backprop for big batchesCUDNN error using pretrained vgg16 modelAttributeError: 'builtin_function_or_method' object has no attribute 'requires_grad'Implementing a custom dataset with PyTorchcupy.cuda.cudnn.CuDNNError: CUDNN_STATUS_INTERNAL_ERRORType Conversionssize mismatch, m1: [3584 x 28], m2: [784 x 128] at /pytorch/aten/src/TH/generic/THTensorMath.cpp:940PyTorch why does the forward function run multiple times and can I change the input shape?













1















I am trying to implement a Character LSTM using Pytorch.But I am getting cudnn_status_bad_params errors.This is the training loop.I getting error on line output = model(input_seq).



for epoch in tqdm(range(epochs)):
for i in range(len(seq)//batch_size):
sidx = i*batch_size
eidx = sidx + batch_size
x = seq[sidx:eidx]
x = torch.tensor(x).cuda()
input_seq =torch.nn.utils.rnn.pack_padded_sequence(x,seq_lengths,batch_first = True)
y = out_seq[sidx:eidx]
output = model(input_seq)
loss = criterion(output,y)
loss.backward()
optimizer.step()
/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py in __call__(self, *input, **kwargs)
487 result = self._slow_forward(*input, **kwargs)
488 else:
--> 489 result = self.forward(*input, **kwargs)
490 for hook in self._forward_hooks.values():
491 hook_result = hook(self, input, result)
/usr/local/lib/python3.6/dist-packages/torch/nn/modules/rnn.py in forward(self, input, hx)
180 else:
181 result = _impl(input, batch_sizes, hx, self._flat_weights, self.bias,
--> 182 self.num_layers, self.dropout, self.training, self.bidirectional)
183 output = result[0]
184 hidden = result[1:] if self.mode == 'LSTM' else result[1]

RuntimeError: cuDNN error: CUDNN_STATUS_BAD_PARAM









share|improve this question




























    1















    I am trying to implement a Character LSTM using Pytorch.But I am getting cudnn_status_bad_params errors.This is the training loop.I getting error on line output = model(input_seq).



    for epoch in tqdm(range(epochs)):
    for i in range(len(seq)//batch_size):
    sidx = i*batch_size
    eidx = sidx + batch_size
    x = seq[sidx:eidx]
    x = torch.tensor(x).cuda()
    input_seq =torch.nn.utils.rnn.pack_padded_sequence(x,seq_lengths,batch_first = True)
    y = out_seq[sidx:eidx]
    output = model(input_seq)
    loss = criterion(output,y)
    loss.backward()
    optimizer.step()
    /usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py in __call__(self, *input, **kwargs)
    487 result = self._slow_forward(*input, **kwargs)
    488 else:
    --> 489 result = self.forward(*input, **kwargs)
    490 for hook in self._forward_hooks.values():
    491 hook_result = hook(self, input, result)
    /usr/local/lib/python3.6/dist-packages/torch/nn/modules/rnn.py in forward(self, input, hx)
    180 else:
    181 result = _impl(input, batch_sizes, hx, self._flat_weights, self.bias,
    --> 182 self.num_layers, self.dropout, self.training, self.bidirectional)
    183 output = result[0]
    184 hidden = result[1:] if self.mode == 'LSTM' else result[1]

    RuntimeError: cuDNN error: CUDNN_STATUS_BAD_PARAM









    share|improve this question


























      1












      1








      1








      I am trying to implement a Character LSTM using Pytorch.But I am getting cudnn_status_bad_params errors.This is the training loop.I getting error on line output = model(input_seq).



      for epoch in tqdm(range(epochs)):
      for i in range(len(seq)//batch_size):
      sidx = i*batch_size
      eidx = sidx + batch_size
      x = seq[sidx:eidx]
      x = torch.tensor(x).cuda()
      input_seq =torch.nn.utils.rnn.pack_padded_sequence(x,seq_lengths,batch_first = True)
      y = out_seq[sidx:eidx]
      output = model(input_seq)
      loss = criterion(output,y)
      loss.backward()
      optimizer.step()
      /usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py in __call__(self, *input, **kwargs)
      487 result = self._slow_forward(*input, **kwargs)
      488 else:
      --> 489 result = self.forward(*input, **kwargs)
      490 for hook in self._forward_hooks.values():
      491 hook_result = hook(self, input, result)
      /usr/local/lib/python3.6/dist-packages/torch/nn/modules/rnn.py in forward(self, input, hx)
      180 else:
      181 result = _impl(input, batch_sizes, hx, self._flat_weights, self.bias,
      --> 182 self.num_layers, self.dropout, self.training, self.bidirectional)
      183 output = result[0]
      184 hidden = result[1:] if self.mode == 'LSTM' else result[1]

      RuntimeError: cuDNN error: CUDNN_STATUS_BAD_PARAM









      share|improve this question
















      I am trying to implement a Character LSTM using Pytorch.But I am getting cudnn_status_bad_params errors.This is the training loop.I getting error on line output = model(input_seq).



      for epoch in tqdm(range(epochs)):
      for i in range(len(seq)//batch_size):
      sidx = i*batch_size
      eidx = sidx + batch_size
      x = seq[sidx:eidx]
      x = torch.tensor(x).cuda()
      input_seq =torch.nn.utils.rnn.pack_padded_sequence(x,seq_lengths,batch_first = True)
      y = out_seq[sidx:eidx]
      output = model(input_seq)
      loss = criterion(output,y)
      loss.backward()
      optimizer.step()
      /usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py in __call__(self, *input, **kwargs)
      487 result = self._slow_forward(*input, **kwargs)
      488 else:
      --> 489 result = self.forward(*input, **kwargs)
      490 for hook in self._forward_hooks.values():
      491 hook_result = hook(self, input, result)
      /usr/local/lib/python3.6/dist-packages/torch/nn/modules/rnn.py in forward(self, input, hx)
      180 else:
      181 result = _impl(input, batch_sizes, hx, self._flat_weights, self.bias,
      --> 182 self.num_layers, self.dropout, self.training, self.bidirectional)
      183 output = result[0]
      184 hidden = result[1:] if self.mode == 'LSTM' else result[1]

      RuntimeError: cuDNN error: CUDNN_STATUS_BAD_PARAM






      pytorch cudnn






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 7 at 15:49









      talonmies

      59.8k17131199




      59.8k17131199










      asked Mar 7 at 11:40









      Sarthak MittalSarthak Mittal

      62




      62






















          1 Answer
          1






          active

          oldest

          votes


















          0














          I got the same error, if you switch to CPU, you'll get a much better description of the error. In my case the problem was in type of input that I was giving to the network. I was sending I guess long, while the model needed float. I made the following changes and the code worked. Basically switching to cpu gives better error descriptions.



          input_seq = input_seq.float().cuda()





          share|improve this answer






















            Your Answer






            StackExchange.ifUsing("editor", function ()
            StackExchange.using("externalEditor", function ()
            StackExchange.using("snippets", function ()
            StackExchange.snippets.init();
            );
            );
            , "code-snippets");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "1"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55042931%2fcudnn-error-cudnn-status-bad-param-can-someone-explain-why-i-am-getting-this-er%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            I got the same error, if you switch to CPU, you'll get a much better description of the error. In my case the problem was in type of input that I was giving to the network. I was sending I guess long, while the model needed float. I made the following changes and the code worked. Basically switching to cpu gives better error descriptions.



            input_seq = input_seq.float().cuda()





            share|improve this answer



























              0














              I got the same error, if you switch to CPU, you'll get a much better description of the error. In my case the problem was in type of input that I was giving to the network. I was sending I guess long, while the model needed float. I made the following changes and the code worked. Basically switching to cpu gives better error descriptions.



              input_seq = input_seq.float().cuda()





              share|improve this answer

























                0












                0








                0







                I got the same error, if you switch to CPU, you'll get a much better description of the error. In my case the problem was in type of input that I was giving to the network. I was sending I guess long, while the model needed float. I made the following changes and the code worked. Basically switching to cpu gives better error descriptions.



                input_seq = input_seq.float().cuda()





                share|improve this answer













                I got the same error, if you switch to CPU, you'll get a much better description of the error. In my case the problem was in type of input that I was giving to the network. I was sending I guess long, while the model needed float. I made the following changes and the code worked. Basically switching to cpu gives better error descriptions.



                input_seq = input_seq.float().cuda()






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Mar 16 at 23:13









                Prateek RawatPrateek Rawat

                1




                1





























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55042931%2fcudnn-error-cudnn-status-bad-param-can-someone-explain-why-i-am-getting-this-er%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Save data to MySQL database using ExtJS and PHP [closed]2019 Community Moderator ElectionHow can I prevent SQL injection in PHP?Which MySQL data type to use for storing boolean valuesPHP: Delete an element from an arrayHow do I connect to a MySQL Database in Python?Should I use the datetime or timestamp data type in MySQL?How to get a list of MySQL user accountsHow Do You Parse and Process HTML/XML in PHP?Reference — What does this symbol mean in PHP?How does PHP 'foreach' actually work?Why shouldn't I use mysql_* functions in PHP?

                    Compiling GNU Global with universal-ctags support Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!Tags for Emacs: Relationship between etags, ebrowse, cscope, GNU Global and exuberant ctagsVim and Ctags tips and trickscscope or ctags why choose one over the other?scons and ctagsctags cannot open option file “.ctags”Adding tag scopes in universal-ctagsShould I use Universal-ctags?Universal ctags on WindowsHow do I install GNU Global with universal ctags support using Homebrew?Universal ctags with emacsHow to highlight ctags generated by Universal Ctags in Vim?

                    Add ONERROR event to image from jsp tldHow to add an image to a JPanel?Saving image from PHP URLHTML img scalingCheck if an image is loaded (no errors) with jQueryHow to force an <img> to take up width, even if the image is not loadedHow do I populate hidden form field with a value set in Spring ControllerStyling Raw elements Generated from JSP tagds with Jquery MobileLimit resizing of images with explicitly set width and height attributeserror TLD use in a jsp fileJsp tld files cannot be resolved