transcranial / keras-js

Run Keras models in the browser, with GPU support using WebGL
https://transcranial.github.io/keras-js
MIT License
4.96k stars 503 forks source link

Conv1D layer: Incompatible combination of dilation_rate with strides #110

Open ttoreli opened 6 years ago

ttoreli commented 6 years ago

When using a simple NN with Conv1D layer, I get this error:

Layer.js:30 Uncaught (in promise) Error: [Conv1D layer: conv1d_1] Incompatible combination of dilation_rate with strides.
    at Conv1D.throwError (webpack:///./src/Layer.js?:30:13)
    at new Conv1D (webpack:///./src/layers/convolutional/Conv1D.js?:68:13)

Since my dilation_rate & strides are both 1, I started looking further. The code believes that typeof dilation_rate and strides are both 'object', rather than 'number'. When I re-casted them using 'parseInt' and forced them to be a number, I ended up with this error:

VM18120:8 Uncaught (in promise) Error: cwise: Arrays do not all have the same shape!
    at assign_cwise_thunk (eval at createThunk (webpack:///./node_modules/cwise-compiler/lib/thunk.js?), <anonymous>:8:71)
    at Object.assign_ndarrayops [as assign] (eval at makeOp (webpack:///./node_modules/ndarray-ops/ndarray-ops.js?), <anonymous>:3:43)
    at Conv2D._w2row (webpack:///./src/layers/convolutional/Conv2D.js?:286:61)
    at Conv2D.setWeights (webpack:///./src/layers/convolutional/Conv2D.js?:142:12)
    at Conv1D.setWeights (webpack:///./src/layers/convolutional/Conv1D.js?:97:20)
    at Model._createLayer (webpack:///./src/Model.js?:504:15)
ttoreli commented 6 years ago

My problem seems to be similar (and occur in the same place in the coded) to this one: "Convolution Layer error" #79