-
Notifications
You must be signed in to change notification settings - Fork 502
Convolution Layer error #79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I think I see the problem. It's coming from
But I think that the line The keras documentation says dilation_rate: an integer or tuple/list of a single integer, specifying the dilation rate to use for dilated convolution. Currently, specifying any dilation_rate value != 1 is incompatible with specifying any strides value != 1. It's a confusing sentence, but I think it means this... |
@Reichenbachian Based on your architecture, shouldn't Btw, I think the original conditional is correct; for
|
Yeah. I reread your condition. I think the condition is correct.
I tried printing the values before the error was thrown, but I'm unable to build keras-js on my computer. (Working on that now, but separate error). |
Ah I see, it's because keras is converting these to tuples internally: https://github.com/fchollet/keras/blob/master/keras/layers/convolutional.py#L104-L107, https://github.com/fchollet/keras/blob/master/keras/layers/convolutional.py#L153-L156 Will need to fix. |
I got it building.
It outputted |
Ah, so they're tuples. Just saw your response. I'll write a patch for now. |
Added
and
It loaded without errors. |
Hi all, is this issue fixed right now?
I am not sure if it is exactly the same problem, it would be awesome if we could fix this. I started by analyzing the shapes of the Strides and Dilation (which are now named h and u?): console.log("[UO] Strides=" + h)
console.log("[UO] Strides isArray=" + Array.isArray(h))
console.log("[UO] DilationRate=" + u)
console.log("[UO] DilationRate isArray=" + Array.isArray(u))
console.log("[UO] (1 !== h)=" + (1 !== h))
console.log("[UO] (1 !== u)=" + (1 !== u)) prints me:
which basically is the problem as far as I understood. I first tried @Reichenbachian 's fix and added: if (Array.isArray(h)) {
h =h[0]
}
if (Array.isArray(u)) {
u = u[0]
} But this throws me:
But there my knowledge ends and I am not sure if that is the problem I want (need) to solve or just a follow up mistake. It would be great if we could work on this. Below some additional information regarding the surroundings: My model architecture: model = Sequential([
Conv1D(3, 3, input_shape=(1024, 1,)),
Conv1D(1, 3),
Flatten(),
Dense(32),
Activation('relu'),
Dense(13),
Activation('softmax'),
]) The data flowing through has the shape (4000, 1024, 1). Training is done within: this Docker image. Data is loaded via jQuery: $.getJSON( data_path + "spectrum.json", function( json ) {
data = json.spectrum_00
}); with spectrum.json looking like: {"spectrum_00": [[6379], [2568], [2089], [1715], ...]} see model.bin attached |
I think I may have fixed it on my local machine and not submitted a PR. I'll do that today. |
Finally pushing patch. I haven't run it, so make sure that it works before merging. I bring it up again, as the dead issue thread was brought back to life - transcranial#79 .
Uh oh!
There was an error while loading. Please reload this page.
On a deep cnn, I'm getting the error "Incompatible combination of dilation_rate with strides."
The model works without problems within keras. Is padding not implemented? Is there a workaround?
Architecture
Tensorflow==1.1.0
Keras==2.0.4
The text was updated successfully, but these errors were encountered: