Giter Club home page Giter Club logo

Comments (6)

prezaei85 avatar prezaei85 commented on June 1, 2024

The error happens in the following function. outputs is a tensor itself and not a list of tensors. I am using Pytorch 0.4. I can't imagine how this can be due to that. Everything else is the same version.

def forward(self, emb, context, state):
        """
        Forward through the decoder.
        Args:
            input (LongTensor): a sequence of input tokens tensors
                                of size (len x batch x nfeats).
            context (FloatTensor): output(tensor sequence) from the encoder
                        RNN of size (src_len x batch x hidden_size).
            state (FloatTensor): hidden state from the encoder RNN for
                                 initializing the decoder.
        Returns:
            outputs (FloatTensor): a Tensor sequence of output from the decoder
                                   of shape (len x batch x hidden_size).
            state (FloatTensor): final hidden state from the decoder.
            attns (dict of (str, FloatTensor)): a dictionary of different
                                type of attention Tensor from the decoder
                                of shape (src_len x batch).
        """
        # Args Check
        assert isinstance(state, RNNDecoderState)
        # END Args Check

        # Run the forward pass of the RNN.
        hidden, outputs, attns = self._run_forward_pass(emb, context, state)

        # Update the state with the result.
        state.update_state(hidden)

        # Concatenates sequence of tensors along a new dimension.
        outputs = torch.stack(outputs)
        for k in attns:
            attns[k] = torch.stack(attns[k])

        return outputs, state, attns

from coarse2fine.

prezaei85 avatar prezaei85 commented on June 1, 2024

I got the PyTorch version 0.2.0.post3 and it works now!

from coarse2fine.

prezaei85 avatar prezaei85 commented on June 1, 2024

I will let the issue open in case it was of interest to make this work with Pytorch 0.4.0.

from coarse2fine.

donglixp avatar donglixp commented on June 1, 2024

Requirements

Install Python dependency

pip install -r requirements.txt

from coarse2fine.

gsh2014 avatar gsh2014 commented on June 1, 2024

I got the PyTorch version 0.2.0.post3 and it works now!

when i type the "pip install -r requirements.txt" but it says "Could not find a version that satisfies the requirement torch==0.2.0.post3"

from coarse2fine.

gsh2014 avatar gsh2014 commented on June 1, 2024

use "conda install pytorch==0.2.0" works !!

from coarse2fine.

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.