{"action":"created","issue":{"url":"https://api.github.com/repos/fchollet/keras/issues/6155","repository_url":"https://api.github.com/repos/fchollet/keras","labels_url":"https://api.github.com/repos/fchollet/keras/issues/6155/labels{/name}","comments_url":"https://api.github.com/repos/fchollet/keras/issues/6155/comments","events_url":"https://api.github.com/repos/fchollet/keras/issues/6155/events","html_url":"https://github.com/fchollet/keras/issues/6155","id":219478858,"number":6155,"title":"Bug: Input layer with an Input layer as input_tensor results in empty _feed_input_names when building a Model, which makes the model unable to train ","user":{"login":"turtleizzy","id":2318046,"avatar_url":"https://avatars2.githubusercontent.com/u/2318046?v=3","gravatar_id":"","url":"https://api.github.com/users/turtleizzy","html_url":"https://github.com/turtleizzy","followers_url":"https://api.github.com/users/turtleizzy/followers","following_url":"https://api.github.com/users/turtleizzy/following{/other_user}","gists_url":"https://api.github.com/users/turtleizzy/gists{/gist_id}","starred_url":"https://api.github.com/users/turtleizzy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/turtleizzy/subscriptions","organizations_url":"https://api.github.com/users/turtleizzy/orgs","repos_url":"https://api.github.com/users/turtleizzy/repos","events_url":"https://api.github.com/users/turtleizzy/events{/privacy}","received_events_url":"https://api.github.com/users/turtleizzy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-04-05T06:13:45Z","updated_at":"2017-04-08T14:25:11Z","closed_at":null,"body":"Environment:\r\n```\r\nUbuntu 16.04,\r\nPython 3.5.3, \r\nKeras 2.0.2 from pypi, \r\nBackend: Tensorflow 1.1.0rc0 (with CUDA, self-compiled)\r\n```\r\n\r\nCode to reproduce this issue:\r\n```\r\nfrom keras.engine.topology import get_source_inputs\r\nfrom keras.layers import Input, Dense\r\nfrom keras.models import Model\r\n\r\ninput_shape = (512, 512, 3)\r\n\r\ninput_tensor = Input(shape = input_shape)\r\nprint (input_tensor._keras_history[0].is_placeholder) # True\r\nx_1 = Dense(16)(input_tensor)\r\nmodel_1 = Model(input_tensor, x_1)\r\nprint (len(model_1. _feed_input_names)>0)  #  True\r\n\r\nimg_input = Input(tensor = input_tensor, shape = input_shape) # <-- Bug here, digested from ./applications/inception_v3.py Line 160\r\n\r\nprint (img_input._keras_history[0].is_placeholder) # False \r\nprint (input_tensor._keras_history[0].is_placeholder) # False <-- Somehow input_tensor is also modified\r\nx_2 = Dense(16)(img_input)\r\ninputs = get_source_inputs(img_input) # digested from ./applications/inception_v3.py Line 353\r\nmodel_2 = Model(inputs, x_2) \r\nprint (len(model_2. _feed_input_names)>0)  #  False\r\n\r\n# model_2.fit(x, y) will result in 'ValueError: The model expects 0 input arrays', which renders this model untrainable.\r\n```\r\n\r\nThis bug was originally found when I tried mitigating my code to Keras 2.x utilizing built-in inception-v3 framework. `fit_on_generator` wouldn't start and complained  `ValueError: The model expects 0 input arrays, but only received one array.` A little bit digging into inception-v3 code revealed this bug.\r\n\r\nA temporary workaround is to change Line 160 in inception_v3.py into `img_input = input_tensor`."},"comment":{"url":"https://api.github.com/repos/fchollet/keras/issues/comments/292721426","html_url":"https://github.com/fchollet/keras/issues/6155#issuecomment-292721426","issue_url":"https://api.github.com/repos/fchollet/keras/issues/6155","id":292721426,"user":{"login":"adambielski","id":14027793,"avatar_url":"https://avatars3.githubusercontent.com/u/14027793?v=3","gravatar_id":"","url":"https://api.github.com/users/adambielski","html_url":"https://github.com/adambielski","followers_url":"https://api.github.com/users/adambielski/followers","following_url":"https://api.github.com/users/adambielski/following{/other_user}","gists_url":"https://api.github.com/users/adambielski/gists{/gist_id}","starred_url":"https://api.github.com/users/adambielski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adambielski/subscriptions","organizations_url":"https://api.github.com/users/adambielski/orgs","repos_url":"https://api.github.com/users/adambielski/repos","events_url":"https://api.github.com/users/adambielski/events{/privacy}","received_events_url":"https://api.github.com/users/adambielski/received_events","type":"User","site_admin":false},"created_at":"2017-04-08T14:25:11Z","updated_at":"2017-04-08T14:25:11Z","body":"Fixed in https://github.com/fchollet/keras/pull/6186"}}
{"actor":{"display_login":"adambielski"}}