{"action":"created","issue":{"url":"https://api.github.com/repos/mila-udem/blocks-examples/issues/62","labels_url":"https://api.github.com/repos/mila-udem/blocks-examples/issues/62/labels{/name}","comments_url":"https://api.github.com/repos/mila-udem/blocks-examples/issues/62/comments","events_url":"https://api.github.com/repos/mila-udem/blocks-examples/issues/62/events","html_url":"https://github.com/mila-udem/blocks-examples/issues/62","id":117870156,"number":62,"title":"machine translation example crashes","user":{"login":"thompsonb","id":3534106,"avatar_url":"https://avatars.githubusercontent.com/u/3534106?v=3","gravatar_id":"","url":"https://api.github.com/users/thompsonb","html_url":"https://github.com/thompsonb","followers_url":"https://api.github.com/users/thompsonb/followers","following_url":"https://api.github.com/users/thompsonb/following{/other_user}","gists_url":"https://api.github.com/users/thompsonb/gists{/gist_id}","starred_url":"https://api.github.com/users/thompsonb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thompsonb/subscriptions","organizations_url":"https://api.github.com/users/thompsonb/orgs","repos_url":"https://api.github.com/users/thompsonb/repos","events_url":"https://api.github.com/users/thompsonb/events{/privacy}","received_events_url":"https://api.github.com/users/thompsonb/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-11-19T17:56:45Z","updated_at":"2015-11-23T12:26:11Z","closed_at":null,"body":"I'm getting the following errors when I try to run the blocks machine translation example (repost from blocks-users, maybe this is a real bug?)\r\n\r\n>> python -m machine_translation \r\n < ... >\r\nINFO:machine_translation:Total number of parameters: 37\r\nINFO:machine_translation:Building model\r\nINFO:machine_translation:Initializing extensions\r\nINFO:machine_translation:Building sampling model\r\nINFO:machine_translation:Building sampler\r\nINFO:machine_translation:Building bleu validator\r\nINFO:machine_translation:Initializing training algorithm\r\nINFO:blocks.algorithms:Taking the cost gradient\r\nINFO:blocks.algorithms:The cost gradient computation graph is built\r\nINFO:machine_translation:Initializing main loop\r\nINFO:blocks.main_loop:Entered the main loop\r\nINFO:blocks.algorithms:Initializing the training algorithm\r\n<<!! BUG IN FGRAPH.REPLACE OR A LISTENER !!>> <type 'exceptions.Exception'> Constant{-1} is already owned by another fgraph local_shape_to_shape_i\r\nERROR (theano.gof.opt): Optimization failure due to: local_shape_to_shape_i\r\nERROR:theano.gof.opt:Optimization failure due to: local_shape_to_shape_i\r\nERROR (theano.gof.opt): node: Shape(for{cpu,grad_of_att_trans_do_apply_scan}.20)\r\nERROR:theano.gof.opt:node: Shape(for{cpu,grad_of_att_trans_do_apply_scan}.20)\r\nERROR (theano.gof.opt): TRACEBACK:\r\nERROR:theano.gof.opt:TRACEBACK:\r\nERROR (theano.gof.opt): Traceback (most recent call last):\r\n  File \"/home/bjt/anaconda/lib/python2.7/site-packages/theano/gof/opt.py\", line 1822, in process_node\r\n    fgraph.replace_all_validate(repl_pairs, reason=lopt)\r\n  File \"/home/bjt/anaconda/lib/python2.7/site-packages/theano/gof/toolbox.py\", line 306, in replace_all_validate\r\n    fgraph.replace(r, new_r, reason=reason, verbose=False)\r\n  File \"/home/bjt/anaconda/lib/python2.7/site-packages/theano/gof/fg.py\", line 592, in replace\r\n    self.change_input(node, i, new_r, reason=reason)\r\n  File \"/home/bjt/anaconda/lib/python2.7/site-packages/theano/gof/fg.py\", line 530, in change_input\r\n    self.__import_r__(new_r, reason=reason)\r\n  File \"/home/bjt/anaconda/lib/python2.7/site-packages/theano/gof/fg.py\", line 363, in __import_r__\r\n    self.__import__(variable.owner, reason=reason)\r\n  File \"/home/bjt/anaconda/lib/python2.7/site-packages/theano/gof/fg.py\", line 394, in __import__\r\n    raise Exception(\"%s is already owned by another fgraph\" % r)\r\nException: Constant{-1} is already owned by another fgraph\r\n\r\nERROR:theano.gof.opt:Traceback (most recent call last):\r\n  File \"/home/bjt/anaconda/lib/python2.7/site-packages/theano/gof/opt.py\", line 1822, in process_node\r\n    fgraph.replace_all_validate(repl_pairs, reason=lopt)\r\n  File \"/home/bjt/anaconda/lib/python2.7/site-packages/theano/gof/toolbox.py\", line 306, in replace_all_validate\r\n    fgraph.replace(r, new_r, reason=reason, verbose=False)\r\n  File \"/home/bjt/anaconda/lib/python2.7/site-packages/theano/gof/fg.py\", line 592, in replace\r\n    self.change_input(node, i, new_r, reason=reason)\r\n  File \"/home/bjt/anaconda/lib/python2.7/site-packages/theano/gof/fg.py\", line 530, in change_input\r\n    self.__import_r__(new_r, reason=reason)\r\n  File \"/home/bjt/anaconda/lib/python2.7/site-packages/theano/gof/fg.py\", line 363, in __import_r__\r\n    self.__import__(variable.owner, reason=reason)\r\n  File \"/home/bjt/anaconda/lib/python2.7/site-packages/theano/gof/fg.py\", line 394, in __import__\r\n    raise Exception(\"%s is already owned by another fgraph\" % r)\r\nException: Constant{-1} is already owned by another fgraph\r\n\r\nERROR (theano.gof.opt): Optimization failure due to: local_subtensor_lift\r\nERROR:theano.gof.opt:Optimization failure due to: local_subtensor_lift\r\nERROR (theano.gof.opt): node: Subtensor{int64}(MakeVector{dtype='int64'}.0, Constant{2})\r\nERROR:theano.gof.opt:node: Subtensor{int64}(MakeVector{dtype='int64'}.0, Constant{2})\r\nERROR (theano.gof.opt): TRACEBACK:\r\nERROR:theano.gof.opt:TRACEBACK:\r\nERROR (theano.gof.opt): Traceback (most recent call last):\r\n  File \"/home/bjt/anaconda/lib/python2.7/site-packages/theano/gof/opt.py\", line 1787, in process_node\r\n    replacements = lopt.transform(node)\r\n  File \"/home/bjt/anaconda/lib/python2.7/site-packages/theano/tensor/opt.py\", line 2559, in local_subtensor_lift\r\n    if not u.owner or len(u.clients) > 1:\r\nAttributeError: 'TensorVariable' object has no attribute 'clients'\r\n\r\nERROR:theano.gof.opt:Traceback (most recent call last):\r\n  File \"/home/bjt/anaconda/lib/python2.7/site-packages/theano/gof/opt.py\", line 1787, in process_node\r\n    replacements = lopt.transform(node)\r\n  File \"/home/bjt/anaconda/lib/python2.7/site-packages/theano/tensor/opt.py\", line 2559, in local_subtensor_lift\r\n    if not u.owner or len(u.clients) > 1:\r\nAttributeError: 'TensorVariable' object has no attribute 'clients'\r\n\r\n< ... many more AttributeErrors for local_add_canonizer, local_mul_canonizer, etc >\r\n\r\nERROR:blocks.main_loop:Error occured during training.\r\n\r\nBlocks will attempt to run `on_error` extensions, potentially saving data, before exiting and reraising the error. Note that the usual `after_training` extensions will *not* be run. The original error will be re-raised and also stored in the training log. Press CTRL + C to halt Blocks immediately.\r\nTraceback (most recent call last):\r\n  File \"/home/bjt/anaconda/lib/python2.7/runpy.py\", line 162, in _run_module_as_main\r\n    \"__main__\", fname, loader, pkg_name)\r\n  File \"/home/bjt/anaconda/lib/python2.7/runpy.py\", line 72, in _run_code\r\n    exec code in run_globals\r\n  File \"/state/partition1/localdata/bjt/blocks-examples/machine_translation/__main__.py\", line 41, in <module>\r\n    get_dev_stream(**configuration), args.bokeh)\r\n  File \"machine_translation/__init__.py\", line 175, in main\r\n    main_loop.run()\r\n  File \"/home/bjt/anaconda/lib/python2.7/site-packages/blocks/main_loop.py\", line 197, in run\r\n    reraise_as(e)\r\n  File \"/home/bjt/anaconda/lib/python2.7/site-packages/blocks/utils/__init__.py\", line 225, in reraise_as\r\n    six.reraise(type(new_exc), new_exc, orig_exc_traceback)\r\n  File \"/home/bjt/anaconda/lib/python2.7/site-packages/blocks/main_loop.py\", line 172, in run\r\n    self.algorithm.initialize()\r\n  File \"/home/bjt/anaconda/lib/python2.7/site-packages/blocks/algorithms/__init__.py\", line 253, in initialize\r\n    self.inputs, [], updates=all_updates, **self.theano_func_kwargs)\r\n  File \"/home/bjt/anaconda/lib/python2.7/site-packages/theano/compile/function.py\", line 317, in function\r\n    output_keys=output_keys)\r\n  File \"/home/bjt/anaconda/lib/python2.7/site-packages/theano/compile/pfunc.py\", line 526, in pfunc\r\n    output_keys=output_keys)\r\n  File \"/home/bjt/anaconda/lib/python2.7/site-packages/theano/compile/function_module.py\", line 1777, in orig_function\r\n    output_keys=output_keys).create(\r\n  File \"/home/bjt/anaconda/lib/python2.7/site-packages/theano/compile/function_module.py\", line 1457, in __init__\r\n    optimizer_profile = optimizer(fgraph)\r\n  File \"/home/bjt/anaconda/lib/python2.7/site-packages/theano/gof/opt.py\", line 101, in __call__\r\n    return self.optimize(fgraph)\r\n  File \"/home/bjt/anaconda/lib/python2.7/site-packages/theano/gof/opt.py\", line 89, in optimize\r\n    ret = self.apply(fgraph, *args, **kwargs)\r\n  File \"/home/bjt/anaconda/lib/python2.7/site-packages/theano/gof/opt.py\", line 230, in apply\r\n    sub_prof = optimizer.optimize(fgraph)\r\n  File \"/home/bjt/anaconda/lib/python2.7/site-packages/theano/gof/opt.py\", line 89, in optimize\r\n    ret = self.apply(fgraph, *args, **kwargs)\r\n  File \"/home/bjt/anaconda/lib/python2.7/site-packages/theano/gof/opt.py\", line 2211, in apply\r\n    lopt_change = self.process_node(fgraph, node, lopt)\r\n  File \"/home/bjt/anaconda/lib/python2.7/site-packages/theano/gof/opt.py\", line 1830, in process_node\r\n    self.failure_callback(e, self, repl_pairs, lopt, node)\r\n  File \"/home/bjt/anaconda/lib/python2.7/site-packages/theano/gof/opt.py\", line 1688, in warn_inplace\r\n    return NavigatorOptimizer.warn(exc, nav, repl_pairs, local_opt, node)\r\n  File \"/home/bjt/anaconda/lib/python2.7/site-packages/theano/gof/opt.py\", line 1674, in warn\r\n    raise exc\r\nAssertionError:\r\n\r\nOriginal exception:\r\n        AssertionError\r\n\r\n::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::\r\nHere are the versions of things that seems relevant:\r\n\r\n>> python --version\r\nPython 2.7.10 :: Anaconda 1.9.1 (64-bit)\r\n\r\n>> python -c \"import theano; print theano.__version__\" \r\n0.7.0.dev-80197cf574b62fa7d869f4de800700d2f75b7f4e\r\n\r\n>> pip install git+git://github.com/mila-udem/blocks.git  -r https://raw.githubusercontent.com/mila-udem/blocks/master/requirements.txt\r\nCollecting git+git://github.com/mila-udem/blocks.git\r\n  Cloning git://github.com/mila-udem/blocks.git to /tmp/pip-VSApNQ-build\r\n  Requirement already satisfied (use --upgrade to upgrade): blocks==0.1.1 from git+git://github.com/mila-udem/blocks.git in /home/bjt/anaconda/lib/python2.7/site-packages\r\nRequirement already satisfied (use --upgrade to upgrade): numpy==1.9.3 in /home/bjt/anaconda/lib/python2.7/site-packages (from -r https://raw.githubusercontent.com/mila-udem/blocks/master/requirements.txt (line 1))\r\nRequirement already satisfied (use --upgrade to upgrade): picklable-itertools==0.1.1 in /home/bjt/anaconda/lib/python2.7/site-packages (from -r https://raw.githubusercontent.com/mila-udem/blocks/master/requirements.txt (line 2))\r\nRequirement already satisfied (use --upgrade to upgrade): progressbar2==2.7.3 in /home/bjt/anaconda/lib/python2.7/site-packages (from -r https://raw.githubusercontent.com/mila-udem/blocks/master/requirements.txt (line 3))\r\nRequirement already satisfied (use --upgrade to upgrade): pyyaml==3.11 in /home/bjt/anaconda/lib/python2.7/site-packages (from -r https://raw.githubusercontent.com/mila-udem/blocks/master/requirements.txt (line 4))\r\nRequirement already satisfied (use --upgrade to upgrade): six==1.9.0 in /home/bjt/anaconda/lib/python2.7/site-packages (from -r https://raw.githubusercontent.com/mila-udem/blocks/master/requirements.txt (line 5))\r\nRequirement already satisfied (use --upgrade to upgrade): toolz==0.7.2 in /home/bjt/anaconda/lib/python2.7/site-packages (from -r https://raw.githubusercontent.com/mila-udem/blocks/master/requirements.txt (line 6))\r\nRequirement already satisfied (use --upgrade to upgrade): theano from git+https://github.com/Theano/Theano.git#egg=theano in /home/bjt/anaconda/lib/python2.7/site-packages (from -r https://raw.githubusercontent.com/mila-udem/blocks/master/requirements.txt (line 9))\r\nRequirement already satisfied (use --upgrade to upgrade): fuel from git+https://github.com/mila-udem/fuel#egg=fuel in /home/bjt/anaconda/lib/python2.7/site-packages (from -r https://raw.githubusercontent.com/mila-udem/blocks/master/requirements.txt (line 12))\r\nRequirement already satisfied (use --upgrade to upgrade): scipy>=0.11 in /home/bjt/anaconda/lib/python2.7/site-packages (from theano->-r https://raw.githubusercontent.com/mila-udem/blocks/master/requirements.txt (line 9))\r\nRequirement already satisfied (use --upgrade to upgrade): h5py in /home/bjt/anaconda/lib/python2.7/site-packages (from fuel->-r https://raw.githubusercontent.com/mila-udem/blocks/master/requirements.txt (line 12))\r\nRequirement already satisfied (use --upgrade to upgrade): tables in /home/bjt/anaconda/lib/python2.7/site-packages (from fuel->-r https://raw.githubusercontent.com/mila-udem/blocks/master/requirements.txt (line 12))\r\nRequirement already satisfied (use --upgrade to upgrade): pyzmq in /home/bjt/anaconda/lib/python2.7/site-packages (from fuel->-r https://raw.githubusercontent.com/mila-udem/blocks/master/requirements.txt (line 12))\r\nRequirement already satisfied (use --upgrade to upgrade): pillow in /home/bjt/anaconda/lib/python2.7/site-packages (from fuel->-r https://raw.githubusercontent.com/mila-udem/blocks/master/requirements.txt (line 12))\r\nRequirement already satisfied (use --upgrade to upgrade): requests in /home/bjt/anaconda/lib/python2.7/site-packages (from fuel->-r https://raw.githubusercontent.com/mila-udem/blocks/master/requirements.txt (line 12)\r\n\r\n>> nvcc --version\r\nnvcc: NVIDIA (R) Cuda compiler driver\r\nCopyright (c) 2005-2014 NVIDIA Corporation\r\nBuilt on Wed_Aug_27_10:36:36_CDT_2014\r\nCuda compilation tools, release 6.5, V6.5.16"},"comment":{"url":"https://api.github.com/repos/mila-udem/blocks-examples/issues/comments/158918791","html_url":"https://github.com/mila-udem/blocks-examples/issues/62#issuecomment-158918791","issue_url":"https://api.github.com/repos/mila-udem/blocks-examples/issues/62","id":158918791,"user":{"login":"sjtufs","id":2394474,"avatar_url":"https://avatars.githubusercontent.com/u/2394474?v=3","gravatar_id":"","url":"https://api.github.com/users/sjtufs","html_url":"https://github.com/sjtufs","followers_url":"https://api.github.com/users/sjtufs/followers","following_url":"https://api.github.com/users/sjtufs/following{/other_user}","gists_url":"https://api.github.com/users/sjtufs/gists{/gist_id}","starred_url":"https://api.github.com/users/sjtufs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sjtufs/subscriptions","organizations_url":"https://api.github.com/users/sjtufs/orgs","repos_url":"https://api.github.com/users/sjtufs/repos","events_url":"https://api.github.com/users/sjtufs/events{/privacy}","received_events_url":"https://api.github.com/users/sjtufs/received_events","type":"User","site_admin":false},"created_at":"2015-11-23T12:26:11Z","updated_at":"2015-11-23T12:26:11Z","body":"@shuboma Hi. You just have to clone the Theano repo, and \r\n`git checkout 9ee4918c0b418ae8863dc0eaab0e220564d6d038` then use `python setup.py install` to install."}}