{"action":"created","issue":{"url":"https://api.github.com/repos/fchollet/keras/issues/1307","labels_url":"https://api.github.com/repos/fchollet/keras/issues/1307/labels{/name}","comments_url":"https://api.github.com/repos/fchollet/keras/issues/1307/comments","events_url":"https://api.github.com/repos/fchollet/keras/issues/1307/events","html_url":"https://github.com/fchollet/keras/pull/1307","id":122929613,"number":1307,"title":"Fix shapes should be tuples.","user":{"login":"gw0","id":803603,"avatar_url":"https://avatars.githubusercontent.com/u/803603?v=3","gravatar_id":"","url":"https://api.github.com/users/gw0","html_url":"https://github.com/gw0","followers_url":"https://api.github.com/users/gw0/followers","following_url":"https://api.github.com/users/gw0/following{/other_user}","gists_url":"https://api.github.com/users/gw0/gists{/gist_id}","starred_url":"https://api.github.com/users/gw0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gw0/subscriptions","organizations_url":"https://api.github.com/users/gw0/orgs","repos_url":"https://api.github.com/users/gw0/repos","events_url":"https://api.github.com/users/gw0/events{/privacy}","received_events_url":"https://api.github.com/users/gw0/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-12-18T11:12:25Z","updated_at":"2015-12-18T17:20:39Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/fchollet/keras/pulls/1307","html_url":"https://github.com/fchollet/keras/pull/1307","diff_url":"https://github.com/fchollet/keras/pull/1307.diff","patch_url":"https://github.com/fchollet/keras/pull/1307.patch"},"body":"It seems that refactoring for multiple backends introduced some typos and some input or output shapes (especially one-dimensional) were not tuples anymore. In some circumstances, like using a LSTM layer with `forget_bias_init='he_normal'`, Keras crashed:\r\n\r\n```\r\n    model.add_node(LSTM(embedding_dim, return_sequences=True, forget_bias_init='he_normal'), name='lstm', input='shared_1')\r\n  File \"/home/xxx/venv/src/keras/keras/layers/containers.py\", line 262, in add_node\r\n    layer.set_previous(self.nodes[input])\r\n  File \"/home/xxx/venv/src/keras/keras/layers/core.py\", line 53, in set_previous\r\n    self.build()\r\n  File \"/home/xxx/venv/src/keras/keras/layers/recurrent.py\", line 328, in build\r\n    self.b_f = self.forget_bias_init((self.output_dim))\r\n  File \"/home/xxx/venv/src/keras/keras/initializations.py\", line 46, in he_normal\r\n    fan_in, fan_out = get_fans(shape)\r\n  File \"/home/xxx/venv/src/keras/keras/initializations.py\", line 7, in get_fans\r\n    fan_in = shape[0] if len(shape) == 2 else np.prod(shape[1:])\r\nTypeError: object of type 'int' has no len()\r\n```"},"comment":{"url":"https://api.github.com/repos/fchollet/keras/issues/comments/165845331","html_url":"https://github.com/fchollet/keras/pull/1307#issuecomment-165845331","issue_url":"https://api.github.com/repos/fchollet/keras/issues/1307","id":165845331,"user":{"login":"fchollet","id":710255,"avatar_url":"https://avatars.githubusercontent.com/u/710255?v=3","gravatar_id":"","url":"https://api.github.com/users/fchollet","html_url":"https://github.com/fchollet","followers_url":"https://api.github.com/users/fchollet/followers","following_url":"https://api.github.com/users/fchollet/following{/other_user}","gists_url":"https://api.github.com/users/fchollet/gists{/gist_id}","starred_url":"https://api.github.com/users/fchollet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fchollet/subscriptions","organizations_url":"https://api.github.com/users/fchollet/orgs","repos_url":"https://api.github.com/users/fchollet/repos","events_url":"https://api.github.com/users/fchollet/events{/privacy}","received_events_url":"https://api.github.com/users/fchollet/received_events","type":"User","site_admin":false},"created_at":"2015-12-18T17:20:39Z","updated_at":"2015-12-18T17:20:39Z","body":"Right, thanks!"}}