{"action":"opened","issue":{"url":"https://api.github.com/repos/tensorflow/models/issues/836","repository_url":"https://api.github.com/repos/tensorflow/models","labels_url":"https://api.github.com/repos/tensorflow/models/issues/836/labels{/name}","comments_url":"https://api.github.com/repos/tensorflow/models/issues/836/comments","events_url":"https://api.github.com/repos/tensorflow/models/issues/836/events","html_url":"https://github.com/tensorflow/models/issues/836","id":198284391,"number":836,"title":"tutorials/rnn/translate Matrix multiplication error","user":{"login":"richardxiong","id":16905075,"avatar_url":"https://avatars.githubusercontent.com/u/16905075?v=3","gravatar_id":"","url":"https://api.github.com/users/richardxiong","html_url":"https://github.com/richardxiong","followers_url":"https://api.github.com/users/richardxiong/followers","following_url":"https://api.github.com/users/richardxiong/following{/other_user}","gists_url":"https://api.github.com/users/richardxiong/gists{/gist_id}","starred_url":"https://api.github.com/users/richardxiong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/richardxiong/subscriptions","organizations_url":"https://api.github.com/users/richardxiong/orgs","repos_url":"https://api.github.com/users/richardxiong/repos","events_url":"https://api.github.com/users/richardxiong/events{/privacy}","received_events_url":"https://api.github.com/users/richardxiong/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-01-01T22:33:27Z","updated_at":"2017-01-01T22:33:27Z","closed_at":null,"body":"**tensorflow/models/tutorials/rnn/translate/seq2seq_model.py**\r\n\r\nHello everyone, \r\n\r\nWhen I ran the translate model, I encountered the following issue:\r\n\r\nFile \"translate.py\", line 294, in main\r\n    train()\r\n  File \"translate.py\", line 153, in train\r\n    model = create_model(sess, False)\r\n  File \"translate.py\", line 132, in create_model\r\n    dtype=dtype)\r\n  File \"/Users/richard_xiong/Documents/DeepLearningMaster/RNN/seq2seq_model.py\", line 181, in __init__\r\n    softmax_loss_function=softmax_loss_function)\r\n  File \"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tensorflow/python/ops/seq2seq.py\", line 1130, in model_with_buckets\r\n    softmax_loss_function=softmax_loss_function))\r\n  File \"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tensorflow/python/ops/seq2seq.py\", line 1058, in sequence_loss\r\n    softmax_loss_function=softmax_loss_function))\r\n  File \"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tensorflow/python/ops/seq2seq.py\", line 1022, in sequence_loss_by_example\r\n    crossent = softmax_loss_function(logit, target)\r\n  File \"/Users/richard_xiong/Documents/DeepLearningMaster/RNN/seq2seq_model.py\", line 117, in sampled_loss\r\n    num_classes=self.target_vocab_size),\r\n  File \"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tensorflow/python/ops/nn.py\", line 1412, in sampled_softmax_loss\r\n    name=name)\r\n  File \"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tensorflow/python/ops/nn.py\", line 1219, in _compute_sampled_logits\r\n    inputs, sampled_w, transpose_b=True) + sampled_b\r\n  File \"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tensorflow/python/ops/math_ops.py\", line 1729, in matmul\r\n    a, b, transpose_a=transpose_a, transpose_b=transpose_b, name=name)\r\n  File \"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tensorflow/python/ops/gen_math_ops.py\", line 1442, in _mat_mul\r\n    transpose_b=transpose_b, name=name)\r\n  File \"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tensorflow/python/framework/op_def_library.py\", line 759, in apply_op\r\n    op_def=op_def)\r\n  File \"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tensorflow/python/framework/ops.py\", line 2242, in create_op\r\n    set_shapes_for_outputs(ret)\r\n  File \"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tensorflow/python/framework/ops.py\", line 1617, in set_shapes_for_outputs\r\n    shapes = shape_func(op)\r\n  File \"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tensorflow/python/framework/ops.py\", line 1568, in call_with_requiring\r\n    return call_cpp_shape_fn(op, require_shape_fn=True)\r\n  File \"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tensorflow/python/framework/common_shapes.py\", line 610, in call_cpp_shape_fn\r\n    debug_python_shape_fn, require_shape_fn)\r\n  File \"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tensorflow/python/framework/common_shapes.py\", line 675, in _call_cpp_shape_fn_impl\r\n    raise ValueError(err.message)\r\n**ValueError**: Shape must be rank 2 but is rank 1 for 'model_with_buckets/sequence_loss/sequence_loss_by_example/sampled_softmax_loss/MatMul_1' (op: 'MatMul') with input shapes: [?], [?,1024].\r\n\r\nIt seems it's the intrinsic matrix multiplication error in the function 'tf.nn.seq2seq.model_with_buckets()'\r\n\r\nDoes anyone have any ideas? Thank you!"}}
{"actor":{"display_login":"richardxiong"}}