Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Error with Zero Mask When using CudaHalfTensor #385

Open
mtanana opened this issue Jan 28, 2017 · 0 comments
Open

Error with Zero Mask When using CudaHalfTensor #385

mtanana opened this issue Jan 28, 2017 · 0 comments

Comments

@mtanana
Copy link

mtanana commented Jan 28, 2017

When running a model using the new CudaHalfTensor, you get an error in the zero mask:

/torch/install/share/lua/5.1/nn/Container.lua:67:
In 2 module of nn.Sequential:
...torch/install/share/lua/5.1/rnn/SeqLSTM.lua:260: invalid arguments: ByteTensor CudaHalfTensor number
expected arguments: [*CudaByteTensor*] CudaHalfTensor half | *CudaHalfTensor* CudaHalfTensor half | [*CudaByteTensor*] CudaHalfTensor CudaHalfTensor | *CudaHalfTensor* CudaHalfTensor CudaHalfTensor
stack traceback:
        [C]: in function 'eq'
        .../torch/install/share/lua/5.1/rnn/SeqLSTM.lua:260: in function <.../torch/install/share/lua/5.1/rnn/SeqLSTM.lua:169>
        [C]: in function 'xpcall'
        ...AA/torch/install/share/lua/5.1/nn/Container.lua:63: in function 'rethrowErrors'
        ...A//torch/install/share/lua/5.1/nn/Sequential.lua:44: in function 'forward'
        ./seq2seq.lua:220: in function 'opfunc'
        ...A//torch/install/share/lua/5.1/optim/adagrad.lua:31: in function 'adagrad'
        ./seq2seq.lua:258: in function 'trainOptim'
        trainoptim.lua:276: in main chunk
        [C]: in function 'dofile'
        .../torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:150: in main chunk
        [C]: at 0x00405810

I think I see where the issue is on line SeqLSTM.lua line 259

self.zeroMask = self.zeroMask or ((torch.type(cur_x) == 'torch.CudaTensor') and torch.CudaByteTensor() or torch.ByteTensor())

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant