{"action":"created","issue":{"url":"https://api.github.com/repos/keras-team/keras/issues/7976","repository_url":"https://api.github.com/repos/keras-team/keras","labels_url":"https://api.github.com/repos/keras-team/keras/issues/7976/labels{/name}","comments_url":"https://api.github.com/repos/keras-team/keras/issues/7976/comments","events_url":"https://api.github.com/repos/keras-team/keras/issues/7976/events","html_url":"https://github.com/keras-team/keras/issues/7976","id":260079464,"node_id":"MDU6SXNzdWUyNjAwNzk0NjQ=","number":7976,"title":"error in keras.layers.merge.concatenate() ","user":{"login":"NikhilShaw","id":22371681,"node_id":"MDQ6VXNlcjIyMzcxNjgx","avatar_url":"https://avatars1.githubusercontent.com/u/22371681?v=4","gravatar_id":"","url":"https://api.github.com/users/NikhilShaw","html_url":"https://github.com/NikhilShaw","followers_url":"https://api.github.com/users/NikhilShaw/followers","following_url":"https://api.github.com/users/NikhilShaw/following{/other_user}","gists_url":"https://api.github.com/users/NikhilShaw/gists{/gist_id}","starred_url":"https://api.github.com/users/NikhilShaw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NikhilShaw/subscriptions","organizations_url":"https://api.github.com/users/NikhilShaw/orgs","repos_url":"https://api.github.com/users/NikhilShaw/repos","events_url":"https://api.github.com/users/NikhilShaw/events{/privacy}","received_events_url":"https://api.github.com/users/NikhilShaw/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-09-24T12:10:02Z","updated_at":"2019-01-02T06:47:26Z","closed_at":null,"author_association":"NONE","body":"Code:\r\n\r\n```\r\nembedding_size = 300\r\n\r\nmodel1 = Sequential([\r\n       Dense(embedding_size, input_shape=(2048,), activation='relu'),\r\n      RepeatVector(max_len)\r\n      ])\r\n\r\nmodel2 = Sequential([\r\n          Embedding(vocab_size, embedding_size, input_length=max_len),\r\n          LSTM(256, return_sequences=True),\r\n           TimeDistributed(Dense(300))\r\n                    ])\r\n\r\nfinal_model = Sequential([\r\n                        **concatenate([model1, model2], axis=1),**\r\n                        Bidirectional(LSTM(256, return_sequences=False)),\r\n                        Dense(vocab_size),\r\n                        Activation('softmax')\r\n                    ])\r\n\r\n\r\nfinal_model.compile(loss='categorical_crossentropy', optimizer=RMSprop(), metrics=['accuracy'])\r\n\r\nfinal_model.summary()\r\nfinal_model.fit_generator(data_generator(batch_size=128), steps_per_epoch=50000,\r\n                                              nb_epoch=1,\r\n                                              verbose=0)\r\n```\r\n\r\n\r\nI am unable to debug the following error:\r\n\r\n```\r\nTraceback (most recent call last):\r\n  File \"/home/rick/.conda/envs/tensorflow-gpu/lib/python3.5/site-packages/keras/engine/topology.py\", line 425, in assert_input_compatibility\r\n    K.is_keras_tensor(x)\r\n  File \"/home/rick/.conda/envs/tensorflow-gpu/lib/python3.5/site-packages/keras/backend/tensorflow_backend.py\", line 403, in is_keras_tensor\r\n    raise ValueError('Unexpectedly found an instance of type `' + str(type(x)) + '`. '\r\nValueError: Unexpectedly found an instance of type `<class 'keras.models.Sequential'>`. Expected a symbolic tensor instance.\r\n\r\nDuring handling of the above exception, another exception occurred:\r\n\r\nTraceback (most recent call last):\r\n  **File \"/home/rick/Downloads/Neural_talk/run.py\", line 245, in <module>\r\n    concatenate([image_model, caption_model], axis=1),**\r\n  File \"/home/rick/.conda/envs/tensorflow-gpu/lib/python3.5/site-packages/keras/layers/merge.py\", line 600, in concatenate\r\n    return Concatenate(axis=axis, **kwargs)(inputs)\r\n  File \"/home/rick/.conda/envs/tensorflow-gpu/lib/python3.5/site-packages/keras/engine/topology.py\", line 558, in __call__\r\n    self.assert_input_compatibility(inputs)\r\n  File \"/home/rick/.conda/envs/tensorflow-gpu/lib/python3.5/site-packages/keras/engine/topology.py\", line 431, in assert_input_compatibility\r\n    str(inputs) + '. All inputs to the layer '\r\nValueError: Layer concatenate_3 was called with an input that isn't a symbolic tensor. Received type: <class 'keras.models.Sequential'>. Full input: [<keras.models.Sequential object at 0x7f8ba413e9e8>, <keras.models.Sequential object at 0x7f8b9dcddf28>]. All inputs to the layer should be tensors.\r\n\r\nProcess finished with exit code 1\r\n```\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/keras-team/keras/issues/comments/450795616","html_url":"https://github.com/keras-team/keras/issues/7976#issuecomment-450795616","issue_url":"https://api.github.com/repos/keras-team/keras/issues/7976","id":450795616,"node_id":"MDEyOklzc3VlQ29tbWVudDQ1MDc5NTYxNg==","user":{"login":"sanaalshboul","id":36659282,"node_id":"MDQ6VXNlcjM2NjU5Mjgy","avatar_url":"https://avatars0.githubusercontent.com/u/36659282?v=4","gravatar_id":"","url":"https://api.github.com/users/sanaalshboul","html_url":"https://github.com/sanaalshboul","followers_url":"https://api.github.com/users/sanaalshboul/followers","following_url":"https://api.github.com/users/sanaalshboul/following{/other_user}","gists_url":"https://api.github.com/users/sanaalshboul/gists{/gist_id}","starred_url":"https://api.github.com/users/sanaalshboul/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sanaalshboul/subscriptions","organizations_url":"https://api.github.com/users/sanaalshboul/orgs","repos_url":"https://api.github.com/users/sanaalshboul/repos","events_url":"https://api.github.com/users/sanaalshboul/events{/privacy}","received_events_url":"https://api.github.com/users/sanaalshboul/received_events","type":"User","site_admin":false},"created_at":"2019-01-02T06:47:26Z","updated_at":"2019-01-02T06:47:26Z","author_association":"NONE","body":"I solved it in this way.\r\n\r\n\r\n    inception_3a_1x1 = Conv2D(64,(1,1),padding='same',activation='relu',name='inception_3a/1x1',kernel_regularizer = regularizers.l2(0.0002))(pool2_3x3_s2)\r\n    \r\n    inception_3a_3x3_reduce = Conv2D(96,(1,1),padding='same',activation='relu',name='inception_3a/3x3_reduce',kernel_regularizer = regularizers.l2(0.0002))(pool2_3x3_s2)\r\n    \r\n    inception_3a_3x3 = Conv2D(128,(3,3),padding='same',activation='relu',name='inception_3a/3x3',kernel_regularizer = regularizers.l2(0.0002))(inception_3a_3x3_reduce)\r\n    \r\n    inception_3a_5x5_reduce = Conv2D(16,(1,1),padding='same',activation='relu',name='inception_3a/5x5_reduce',kernel_regularizer = regularizers.l2(0.0002))(pool2_3x3_s2)\r\n    \r\n    inception_3a_5x5 = Conv2D(32,(5,5),padding='same',activation='relu',name='inception_3a/5x5',kernel_regularizer = regularizers.l2(0.0002))(inception_3a_5x5_reduce)\r\n    \r\n    inception_3a_pool = MaxPooling2D(pool_size=(3,3),strides=(1,1),padding='same',name='inception_3a/pool')(pool2_3x3_s2)\r\n    \r\n    inception_3a_pool_proj = Conv2D(32,(1,1),padding='same',activation='relu',name='inception_3a/pool_proj',kernel_regularizer = regularizers.l2(0.0002))(inception_3a_pool)\r\n    \r\n    inception_3a_output = concatenate([inception_3a_1x1,inception_3a_3x3,inception_3a_5x5,inception_3a_pool_proj],axis=-1,name='inception_3a/output')\r\n    \"\"\"End of Block1\"\"\""}}
{"actor":{"display_login":"sanaalshboul"}}