{"action":"created","issue":{"url":"https://api.github.com/repos/Lsdefine/attention-is-all-you-need-keras/issues/3","repository_url":"https://api.github.com/repos/Lsdefine/attention-is-all-you-need-keras","labels_url":"https://api.github.com/repos/Lsdefine/attention-is-all-you-need-keras/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/Lsdefine/attention-is-all-you-need-keras/issues/3/comments","events_url":"https://api.github.com/repos/Lsdefine/attention-is-all-you-need-keras/issues/3/events","html_url":"https://github.com/Lsdefine/attention-is-all-you-need-keras/issues/3","id":340034510,"node_id":"MDU6SXNzdWUzNDAwMzQ1MTA=","number":3,"title":"Issues with Keras Lambda Layers","user":{"login":"wfmonster","id":3928893,"node_id":"MDQ6VXNlcjM5Mjg4OTM=","avatar_url":"https://avatars0.githubusercontent.com/u/3928893?v=4","gravatar_id":"","url":"https://api.github.com/users/wfmonster","html_url":"https://github.com/wfmonster","followers_url":"https://api.github.com/users/wfmonster/followers","following_url":"https://api.github.com/users/wfmonster/following{/other_user}","gists_url":"https://api.github.com/users/wfmonster/gists{/gist_id}","starred_url":"https://api.github.com/users/wfmonster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wfmonster/subscriptions","organizations_url":"https://api.github.com/users/wfmonster/orgs","repos_url":"https://api.github.com/users/wfmonster/repos","events_url":"https://api.github.com/users/wfmonster/events{/privacy}","received_events_url":"https://api.github.com/users/wfmonster/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-07-10T22:54:48Z","updated_at":"2018-07-11T06:19:06Z","closed_at":null,"author_association":"NONE","body":"I'm running into a lot of errors attempting to run the Transformer.py file for testing purposes. \r\n\r\nThe issue begins with:\r\n```Using TensorFlow backend.\r\n(100000, 7) (100000, 9)\r\nX:  [[ 2 11 12 ...  7  4  3]\r\n [ 2 10 11 ... 12 12  3]\r\n [ 2  5  5 ... 13  6  3]\r\n ...\r\n [ 2 13 11 ... 12  5  3]\r\n [ 2  7 12 ...  6 11  3]\r\n [ 2  6  4 ...  7 13  3]]\r\nY:  [[ 2  4 20 ... 19 14  3]\r\n [ 2  4 20 ... 11  8  3]\r\n [ 2  4 20 ...  8  3  0]\r\n ...\r\n [ 2  4 20 ... 19  9  3]\r\n [ 2  4 20 ... 19  3  0]\r\n [ 2  4 20 ... 15  3  0]]\r\n2018-07-10 18:46:13.676502: I tensorflow/core/platform/cpu_feature_guard.cc:140] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA\r\nTraceback (most recent call last):\r\n  File \"transformer.py\", line 586, in <module>\r\n    s2s.compile('adam')\r\n  File \"transformer.py\", line 396, in compile\r\n    enc_output = self.encoder(src_seq, src_pos, active_layers=active_layers)\r\n  File \"transformer.py\", line 306, in __call__\r\n    mask = Lambda(lambda x:GetPadMask(emb, emb))(src_seq)\r\n  File \"/Users/user/anaconda2/envs/tfdeeplearning/lib/python3.6/site-packages/keras/engine/base_layer.py\", line 460, in __call__\r\n    output = self.call(inputs, **kwargs)\r\n  File \"/Users/user/anaconda2/envs/tfdeeplearning/lib/python3.6/site-packages/keras/layers/core.py\", line 693, in call\r\n    return self.function(inputs, **arguments)\r\n  File \"transformer.py\", line 306, in <lambda>\r\n    mask = Lambda(lambda x:GetPadMask(emb, emb))(src_seq)\r\n  File \"transformer.py\", line 255, in GetPadMask\r\n    ones = K.expand_dims(K.ones_like(Q, 'float32'), -1)\r\nAttributeError: 'Tensor' object has no attribute 'expand_dims'\r\n```\r\n\r\nWhat version of Keras and Tensorflow are you using to develop?\r\nCould you add that info to a requirements.txt file or possibly to the readme info.\r\nI am wondering if this is an issue between conflicting versions. \r\nI am using:\r\n`\r\ntensorflow 1.8.0\r\nKeras         2.2.0\r\n`\r\n\r\nI've tried wrapping the operations in Lambda Layers which works for the first two lines in \r\nGetPadMask Function but I am running into issues again with the K.batch_dot Operation.\r\nAn Ideas? I am relatively new to the Keras framework. \r\n\r\n \r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/Lsdefine/attention-is-all-you-need-keras/issues/comments/404057728","html_url":"https://github.com/Lsdefine/attention-is-all-you-need-keras/issues/3#issuecomment-404057728","issue_url":"https://api.github.com/repos/Lsdefine/attention-is-all-you-need-keras/issues/3","id":404057728,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNDA1NzcyOA==","user":{"login":"wfmonster","id":3928893,"node_id":"MDQ6VXNlcjM5Mjg4OTM=","avatar_url":"https://avatars0.githubusercontent.com/u/3928893?v=4","gravatar_id":"","url":"https://api.github.com/users/wfmonster","html_url":"https://github.com/wfmonster","followers_url":"https://api.github.com/users/wfmonster/followers","following_url":"https://api.github.com/users/wfmonster/following{/other_user}","gists_url":"https://api.github.com/users/wfmonster/gists{/gist_id}","starred_url":"https://api.github.com/users/wfmonster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wfmonster/subscriptions","organizations_url":"https://api.github.com/users/wfmonster/orgs","repos_url":"https://api.github.com/users/wfmonster/repos","events_url":"https://api.github.com/users/wfmonster/events{/privacy}","received_events_url":"https://api.github.com/users/wfmonster/received_events","type":"User","site_admin":false},"created_at":"2018-07-11T06:19:06Z","updated_at":"2018-07-11T06:19:06Z","author_association":"NONE","body":"Yes, K is the tf.keras.backend.  I went ahead and cloned a new version of the repository, and the fresh code is running fine now. I must have made an error somewhere while working on modifications. Thank you for getting back to me.\r\n\r\nI was also curious about the new QANET blocks you've added. Do you have more info on this or is it for personal research purposes (if you don't mind elaborating)? I currently do NMT research so I would be interested in any additional materials or thoughts. "}}
{"actor":{"display_login":"wfmonster"}}