-
Notifications
You must be signed in to change notification settings - Fork 65
Error in Conv1D after Lambda dropping 1 input axis #161
Comments
@michelegalante Hi, thank you for submitting this issue. We will take a look. Mean while, maybe there is some work arounds to explore for your use case? How about creating another input with x[:,:,1,:] and concatenate to your network. |
Hi roywei, after some research I found this workaround: import keras
def select_axis(x):
return keras.backend.reshape(x[:,:,1,:], (-1,NFEATURES,NSTEPS))
NSTEPS=100
NFEATURES=10
NGROUPS=3
a = keras.layers.Input((NFEATURES,NGROUPS,NSTEPS))
print(a.shape)
b = keras.layers.Lambda(select_axis)(a)
print(b.shape)
c = keras.layers.Conv1D(8, 5)(b)
print(c.shape) I suspect the problem is related to #113 and #120 (incorrect shape after slice operation). |
@michelegalante Yes, the shape information is lost after slicing in Lambda, during infer_shape_partial() on mxnet symbol. |
Can you please install MXNet master build to get the fix. You can do with --pre option in pypi
|
On my side with mxnet-mkl --pre it's failing with the following error:
|
This code uses a Lambda layer to select a subset of the input (data format is
channels_first
):With tensorflow backend I get this output, as expected:
But with mxnet backend I get an error in Conv1D:
The text was updated successfully, but these errors were encountered: