broadinstitute / keras-resnet

Keras package for deep residual networks
Other
300 stars 127 forks source link

1D has 2D kernels #60

Open wrrogers opened 4 years ago

wrrogers commented 4 years ago

Seems 1D models are set to use 2D kernels. I went to use a 1D model and got the error:

ValueError: The kernel_size argument must be a tuple of 1 integers. Received: (7, 7)

gitergreat commented 4 years ago

Yeah, it also confuse me a lot.

vincenzodentamaro commented 4 years ago

same error here

andresdigiovanni commented 4 years ago

Same error.

In keras_resnet/models/_id.py

x = keras.layers.Conv1D(64, (7, 7), strides=(2, 2), use_bias=False, name="conv1")(x) and x = keras.layers.MaxPooling1D((3, 3), strides=(2, 2), padding="same", name="pool1")(x)

should be:

x = keras.layers.Conv1D(64, 7, strides=2, use_bias=False, name="conv1")(x) and x = keras.layers.MaxPooling1D(3, strides=2, padding="same", name="pool1")(x)

vincenzodentamaro commented 4 years ago

I have proposed a fix by uploading the code I have modified to work with 1D time series.

unnir commented 4 years ago

so, this is the issue.

aadnesd commented 3 years ago

I have a dataset with 1600 rows and 103 columns, when I used Conv1D in a sequential model I reshaped my data to (1600,103,1) and put the input_shape=(103,1) it worked fine. But when I use this model, after adding the fix in regards to kernel and strides, and shape (103,1) I get this error: ValueError: Input 0 of layer conv1 is incompatible with the layer: : expected min_ndim=4, found ndim=3. Full shape received: (None, 103, 1)

@tackoo

aadnesd commented 3 years ago

@tackoo there is still the dimension problem after the fixes

vincenzodentamaro commented 3 years ago

I made a fork fixing this issue https://github.com/vincenzodentamaro/keras-resnet

Il giorno ven 16 apr 2021 alle ore 12:01 aadnesd @.***> ha scritto:

@tackoo https://github.com/tackoo there is still the dimension problem after the fixes

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/broadinstitute/keras-resnet/issues/60#issuecomment-821066348, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABEG5KCCJM7O65SHLBDGAJDTJADJJANCNFSM4IWDZ36Q .

-- Dr. Vincenzo Dentamaro Information Systems Lab Università degli Studi di Bari "Aldo Moro" Department of Computer Science Via Orabona 4, 70124 Bari, Italy

aadnesd commented 3 years ago

Is it possible to install this fork?

vincenzodentamaro commented 3 years ago

pip install git+https://github.com/vincenzodentamaro/keras-resnet.git Il giorno ven 16 apr 2021 alle ore 12:42 aadnesd @.***> ha scritto:

Is it possible to install this fork?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/broadinstitute/keras-resnet/issues/60#issuecomment-821087448, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABEG5KFRPAXEOGAN7TSU7PDTJAIBPANCNFSM4IWDZ36Q .

-- Dr. Vincenzo Dentamaro Information Systems Lab Università degli Studi di Bari "Aldo Moro" Department of Computer Science Via Orabona 4, 70124 Bari, Italy