{"action":"created","issue":{"url":"https://api.github.com/repos/fchollet/keras/issues/5032","repository_url":"https://api.github.com/repos/fchollet/keras","labels_url":"https://api.github.com/repos/fchollet/keras/issues/5032/labels{/name}","comments_url":"https://api.github.com/repos/fchollet/keras/issues/5032/comments","events_url":"https://api.github.com/repos/fchollet/keras/issues/5032/events","html_url":"https://github.com/fchollet/keras/issues/5032","id":200683003,"number":5032,"title":"Convolution layer + LSTM layer, input_dim error","user":{"login":"Mako18","id":25105487,"avatar_url":"https://avatars.githubusercontent.com/u/25105487?v=3","gravatar_id":"","url":"https://api.github.com/users/Mako18","html_url":"https://github.com/Mako18","followers_url":"https://api.github.com/users/Mako18/followers","following_url":"https://api.github.com/users/Mako18/following{/other_user}","gists_url":"https://api.github.com/users/Mako18/gists{/gist_id}","starred_url":"https://api.github.com/users/Mako18/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mako18/subscriptions","organizations_url":"https://api.github.com/users/Mako18/orgs","repos_url":"https://api.github.com/users/Mako18/repos","events_url":"https://api.github.com/users/Mako18/events{/privacy}","received_events_url":"https://api.github.com/users/Mako18/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":11,"created_at":"2017-01-13T17:24:02Z","updated_at":"2017-01-18T12:38:26Z","closed_at":null,"body":"Hi, I'm trying to desing a net combining CNN layers with LSTM layer. I have three inputs that are gray-scale images. First I create a CNN layer to each input so it can learn spatial patrons and after that I merge the three inputs. Now I want my net to learn about time patrons, so I have 1730 samples (each sample is a different time) for each input. \r\nThe problem is that when I merge it and try to compute the LSTM layer, it gives me the next error:\r\n\r\n`ValueError: Input 0 is incompatible with layer lstm_6: expected ndim=3, found ndim=4 `\r\n\r\nMy inputs shape are (1,8,10) (80 pixels images). My code  is:\r\n\r\n`Izd=Sequential()`\r\n`Izd.add(Convolution2D(40,3,3, input_shape=(1,8,10),border_mode='same'))` \r\n`Izd.add(Activation('relu'))`\r\n`Izd.add(MaxPooling2D(pool_size=(2,2)))`\r\n`Izd.add(Dropout(0.2))`\r\n\r\n`Dcha=Sequential()`\r\n`Dcha.add(Convolution2D(40,3,3, input_shape=(1,8,10),border_mode='same'))`\r\n`Dcha.add(Activation('relu'))`\r\n`Dcha.add(MaxPooling2D(pool_size=(2,2)))`\r\n\r\n`Frt=Sequential()`\r\n`Frt.add(Convolution2D(40,3,3,input_shape(1,8,10),border_mode='same'))`\r\n`Frt.add(Activation('relu'))`\r\n`Frt.add(MaxPooling2D(pool_size=(2,2)))`\r\n\r\n`merged=merge([Izda, Dcha,Frt], mode='concat', concat_axis=1)`\r\n\r\n`model=Sequential()`\r\n`model.add(merged)`\r\n`model.add(LSTM(240))`\r\n\r\n\r\nI would like to know if there is a way to create a network with convolutional layer and lstm layer with a 2D input. I have seen examples with words and sentences, but not with images and I don't know what kind of input LSTM expect.\r\n\r\nThanks."},"comment":{"url":"https://api.github.com/repos/fchollet/keras/issues/comments/273464845","html_url":"https://github.com/fchollet/keras/issues/5032#issuecomment-273464845","issue_url":"https://api.github.com/repos/fchollet/keras/issues/5032","id":273464845,"user":{"login":"wookaka","id":19773572,"avatar_url":"https://avatars.githubusercontent.com/u/19773572?v=3","gravatar_id":"","url":"https://api.github.com/users/wookaka","html_url":"https://github.com/wookaka","followers_url":"https://api.github.com/users/wookaka/followers","following_url":"https://api.github.com/users/wookaka/following{/other_user}","gists_url":"https://api.github.com/users/wookaka/gists{/gist_id}","starred_url":"https://api.github.com/users/wookaka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wookaka/subscriptions","organizations_url":"https://api.github.com/users/wookaka/orgs","repos_url":"https://api.github.com/users/wookaka/repos","events_url":"https://api.github.com/users/wookaka/events{/privacy}","received_events_url":"https://api.github.com/users/wookaka/received_events","type":"User","site_admin":false},"created_at":"2017-01-18T12:38:26Z","updated_at":"2017-01-18T12:38:26Z","body":"Are you talking aboiut 3DCNN , which can process multiple images at same time. You want to get features of first three different images as first step of lstm, then next feature of three images to be second step. Am i right？ @Mako18 "}}
{"actor":{"display_login":"wookaka"}}