{"action":"created","issue":{"url":"https://api.github.com/repos/Theano/Theano/issues/5273","repository_url":"https://api.github.com/repos/Theano/Theano","labels_url":"https://api.github.com/repos/Theano/Theano/issues/5273/labels{/name}","comments_url":"https://api.github.com/repos/Theano/Theano/issues/5273/comments","events_url":"https://api.github.com/repos/Theano/Theano/issues/5273/events","html_url":"https://github.com/Theano/Theano/issues/5273","id":191228485,"number":5273,"title":"commit 7455188 causes ValueError: ('You cannot drop a non-broadcastable dimension.', ((False, True, False), (0, 'x', 1, 'x')))","user":{"login":"Spaak","id":3042751,"avatar_url":"https://avatars.githubusercontent.com/u/3042751?v=3","gravatar_id":"","url":"https://api.github.com/users/Spaak","html_url":"https://github.com/Spaak","followers_url":"https://api.github.com/users/Spaak/followers","following_url":"https://api.github.com/users/Spaak/following{/other_user}","gists_url":"https://api.github.com/users/Spaak/gists{/gist_id}","starred_url":"https://api.github.com/users/Spaak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Spaak/subscriptions","organizations_url":"https://api.github.com/users/Spaak/orgs","repos_url":"https://api.github.com/users/Spaak/repos","events_url":"https://api.github.com/users/Spaak/events{/privacy}","received_events_url":"https://api.github.com/users/Spaak/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-11-23T10:00:54Z","updated_at":"2016-11-23T19:18:22Z","closed_at":null,"body":"On commit 810e4c8, my PyMC3-based code (using variational inference) still worked fine, but on commit 7455188, this breaks with the stack trace pasted below. As far as I can check this is not a PyMC3 error, since simply reverting to 810e4c8 solves the issue.\r\n\r\n```\r\n    params = mc.variational.advi(n=1000, learning_rate=1, start=model.test_point)\r\n  File \"/home/eelke/repos/pymc3/pymc3/variational/advi.py\", line 139, in advi\r\n    updates = optimizer(loss=-1 * elbo, param=[uw_shared])\r\n  File \"/home/eelke/repos/pymc3/pymc3/variational/advi.py\", line 257, in optimizer\r\n    grad = tt.grad(loss, param_)\r\n  File \"/home/eelke/repos/Theano/theano/gradient.py\", line 553, in grad\r\n    grad_dict, wrt, cost_name)\r\n  File \"/home/eelke/repos/Theano/theano/gradient.py\", line 1317, in _populate_grad_dict\r\n    rval = [access_grad_cache(elem) for elem in wrt]\r\n  File \"/home/eelke/repos/Theano/theano/gradient.py\", line 1317, in <listcomp>\r\n    rval = [access_grad_cache(elem) for elem in wrt]\r\n  File \"/home/eelke/repos/Theano/theano/gradient.py\", line 1272, in access_grad_cache\r\n    term = access_term_cache(node)[idx]\r\n  File \"/home/eelke/repos/Theano/theano/gradient.py\", line 965, in access_term_cache\r\n    output_grads = [access_grad_cache(var) for var in node.outputs]\r\n  File \"/home/eelke/repos/Theano/theano/gradient.py\", line 965, in <listcomp>\r\n    output_grads = [access_grad_cache(var) for var in node.outputs]\r\n  File \"/home/eelke/repos/Theano/theano/gradient.py\", line 1272, in access_grad_cache\r\n    term = access_term_cache(node)[idx]\r\n  File \"/home/eelke/repos/Theano/theano/gradient.py\", line 965, in access_term_cache\r\n    output_grads = [access_grad_cache(var) for var in node.outputs]\r\n  File \"/home/eelke/repos/Theano/theano/gradient.py\", line 965, in <listcomp>\r\n    output_grads = [access_grad_cache(var) for var in node.outputs]\r\n  File \"/home/eelke/repos/Theano/theano/gradient.py\", line 1272, in access_grad_cache\r\n    term = access_term_cache(node)[idx]\r\n  File \"/home/eelke/repos/Theano/theano/gradient.py\", line 965, in access_term_cache\r\n    output_grads = [access_grad_cache(var) for var in node.outputs]\r\n  File \"/home/eelke/repos/Theano/theano/gradient.py\", line 965, in <listcomp>\r\n    output_grads = [access_grad_cache(var) for var in node.outputs]\r\n  File \"/home/eelke/repos/Theano/theano/gradient.py\", line 1272, in access_grad_cache\r\n    term = access_term_cache(node)[idx]\r\n  File \"/home/eelke/repos/Theano/theano/gradient.py\", line 965, in access_term_cache\r\n    output_grads = [access_grad_cache(var) for var in node.outputs]\r\n  File \"/home/eelke/repos/Theano/theano/gradient.py\", line 965, in <listcomp>\r\n    output_grads = [access_grad_cache(var) for var in node.outputs]\r\n  File \"/home/eelke/repos/Theano/theano/gradient.py\", line 1272, in access_grad_cache\r\n    term = access_term_cache(node)[idx]\r\n  File \"/home/eelke/repos/Theano/theano/gradient.py\", line 965, in access_term_cache\r\n    output_grads = [access_grad_cache(var) for var in node.outputs]\r\n  File \"/home/eelke/repos/Theano/theano/gradient.py\", line 965, in <listcomp>\r\n    output_grads = [access_grad_cache(var) for var in node.outputs]\r\n  File \"/home/eelke/repos/Theano/theano/gradient.py\", line 1272, in access_grad_cache\r\n    term = access_term_cache(node)[idx]\r\n  File \"/home/eelke/repos/Theano/theano/gradient.py\", line 965, in access_term_cache\r\n    output_grads = [access_grad_cache(var) for var in node.outputs]\r\n  File \"/home/eelke/repos/Theano/theano/gradient.py\", line 965, in <listcomp>\r\n    output_grads = [access_grad_cache(var) for var in node.outputs]\r\n  File \"/home/eelke/repos/Theano/theano/gradient.py\", line 1272, in access_grad_cache\r\n    term = access_term_cache(node)[idx]\r\n  File \"/home/eelke/repos/Theano/theano/gradient.py\", line 965, in access_term_cache\r\n    output_grads = [access_grad_cache(var) for var in node.outputs]\r\n  File \"/home/eelke/repos/Theano/theano/gradient.py\", line 965, in <listcomp>\r\n    output_grads = [access_grad_cache(var) for var in node.outputs]\r\n  File \"/home/eelke/repos/Theano/theano/gradient.py\", line 1272, in access_grad_cache\r\n    term = access_term_cache(node)[idx]\r\n  File \"/home/eelke/repos/Theano/theano/gradient.py\", line 1106, in access_term_cache\r\n    new_output_grads)\r\n  File \"/home/eelke/repos/Theano/theano/gof/op.py\", line 700, in L_op\r\n    return self.grad(inputs, output_grads)\r\n  File \"/home/eelke/repos/Theano/theano/tensor/elemwise.py\", line 717, in grad\r\n    sr = sr.dimshuffle(shuffle)\r\n  File \"/home/eelke/repos/Theano/theano/tensor/var.py\", line 363, in dimshuffle\r\n    pattern)\r\n  File \"/home/eelke/repos/Theano/theano/tensor/elemwise.py\", line 175, in __init__\r\n    (input_broadcastable, new_order))\r\nValueError: ('You cannot drop a non-broadcastable dimension.', ((False, True, False), (0, 'x', 1, 'x')))\r\n```\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/Theano/Theano/issues/comments/262607020","html_url":"https://github.com/Theano/Theano/issues/5273#issuecomment-262607020","issue_url":"https://api.github.com/repos/Theano/Theano/issues/5273","id":262607020,"user":{"login":"nouiz","id":180987,"avatar_url":"https://avatars.githubusercontent.com/u/180987?v=3","gravatar_id":"","url":"https://api.github.com/users/nouiz","html_url":"https://github.com/nouiz","followers_url":"https://api.github.com/users/nouiz/followers","following_url":"https://api.github.com/users/nouiz/following{/other_user}","gists_url":"https://api.github.com/users/nouiz/gists{/gist_id}","starred_url":"https://api.github.com/users/nouiz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nouiz/subscriptions","organizations_url":"https://api.github.com/users/nouiz/orgs","repos_url":"https://api.github.com/users/nouiz/repos","events_url":"https://api.github.com/users/nouiz/events{/privacy}","received_events_url":"https://api.github.com/users/nouiz/received_events","type":"User","site_admin":false},"created_at":"2016-11-23T19:18:22Z","updated_at":"2016-11-23T19:18:22Z","body":"Thanks for the report and finding the commit that introduced this.\r\n\r\nCan you easily share code that reproduce this? I wasn't able to easily reproduce this."}}
{"actor":{"display_login":"nouiz"}}