Skip to content
This repository has been archived by the owner on Jan 3, 2023. It is now read-only.

LookupTable followed by Conv layer causes error #221

Closed
ylhsieh opened this issue Mar 25, 2016 · 3 comments
Closed

LookupTable followed by Conv layer causes error #221

ylhsieh opened this issue Mar 25, 2016 · 3 comments
Assignees
Milestone

Comments

@ylhsieh
Copy link

ylhsieh commented Mar 25, 2016

A small example like:

layers = [LookupTable(vocab_size=1000, embedding_dim=100),
          Conv((2, 2, 64), strides=1)]

would produce the following error message using gpu backend

File "/usr/local/lib/python2.7/dist-packages/neon/backends/convolution.py", line 758, in _magic32
    nc = ((nmax + 1) // d) * d - 1
ZeroDivisionError: integer division or modulo by zero

and using cpu backend would produce

File "/usr/local/lib/python2.7/dist-packages/neon/backends/nervanacpu.py", line 1343, in fprop_pool
    array_O = O._tensor.reshape(layer.dimO)
ValueError: can only specify one unknown dimension

Is there a proper way to shape outputs of LookupTable for use in the Conv layer? Thanks.

@yinyinl
Copy link
Contributor

yinyinl commented Mar 25, 2016

This layer combination is not supported in neon currently. Conv layer is not able to handle the out_shape from lookuptable layer, since lookuptable layer out_shape is a tuple with a time dimension as the 2nd element.
We are working on adding a reshape layer, which allows more flexible combination of various layer types, and hopefully release that soon. And we will make sure your example works as a test case. Thanks.

@jennifermyers
Copy link
Contributor

Closing this issue as reshape layer is now available in neon 1.6.0.

@yinyinl
Copy link
Contributor

yinyinl commented Sep 21, 2016

Please take a look at the test for reshape layer for layer combination examples.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants