{"action":"created","issue":{"url":"https://api.github.com/repos/iamaaditya/VQA_Demo/issues/7","repository_url":"https://api.github.com/repos/iamaaditya/VQA_Demo","labels_url":"https://api.github.com/repos/iamaaditya/VQA_Demo/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/iamaaditya/VQA_Demo/issues/7/comments","events_url":"https://api.github.com/repos/iamaaditya/VQA_Demo/issues/7/events","html_url":"https://github.com/iamaaditya/VQA_Demo/issues/7","id":183201234,"number":7,"title":"Predict function is showing error","user":{"login":"iqbal-chowdhury","id":10893471,"avatar_url":"https://avatars.githubusercontent.com/u/10893471?v=3","gravatar_id":"","url":"https://api.github.com/users/iqbal-chowdhury","html_url":"https://github.com/iqbal-chowdhury","followers_url":"https://api.github.com/users/iqbal-chowdhury/followers","following_url":"https://api.github.com/users/iqbal-chowdhury/following{/other_user}","gists_url":"https://api.github.com/users/iqbal-chowdhury/gists{/gist_id}","starred_url":"https://api.github.com/users/iqbal-chowdhury/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iqbal-chowdhury/subscriptions","organizations_url":"https://api.github.com/users/iqbal-chowdhury/orgs","repos_url":"https://api.github.com/users/iqbal-chowdhury/repos","events_url":"https://api.github.com/users/iqbal-chowdhury/events{/privacy}","received_events_url":"https://api.github.com/users/iqbal-chowdhury/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2016-10-15T10:09:40Z","updated_at":"2016-10-17T06:51:52Z","closed_at":null,"body":"Hi, \r\n\r\nThank you for this interactive demo of VQA. Anyway while running the prediction cell:\r\n\r\n`y_output = model_vqa.predict([question_features, image_features])\r\n\r\nlabelencoder = joblib.load(label_encoder_file_name)\r\nfor label in reversed(np.argsort(y_output)[0,-5:]):\r\n    print str(round(y_output[0,label]*100,2)).zfill(5), \"% \", labelencoder.inverse_transform(label)`\r\n\r\n**Then it showing some error just as below:**\r\n\r\n`ValueError                                Traceback (most recent call last)\r\n<ipython-input-26-fd953e22fb19> in <module>()\r\n----> 1 y_output = model_vqa.predict([question_features, image_features])\r\n      2 \r\n      3 # This task here is represented as a classification into a 1000 top answers\r\n      4 # this means some of the answers were not part of training and thus would\r\n      5 # not show up in the result.\r\n\r\n/usr/local/lib/python2.7/dist-packages/Keras-1.0.2-py2.7.egg/keras/models.pyc in predict(self, x, batch_size, verbose)\r\n    454         if self.model is None:\r\n    455             raise Exception('The model needs to be compiled before being used.')\r\n--> 456         return self.model.predict(x, batch_size=batch_size, verbose=verbose)\r\n    457 \r\n    458     def predict_on_batch(self, x):\r\n\r\n/usr/local/lib/python2.7/dist-packages/Keras-1.0.2-py2.7.egg/keras/engine/training.pyc in predict(self, x, batch_size, verbose)\r\n   1117         f = self.predict_function\r\n   1118         return self._predict_loop(f, ins,\r\n-> 1119                                   batch_size=batch_size, verbose=verbose)\r\n   1120 \r\n   1121     def train_on_batch(self, x, y,\r\n\r\n/usr/local/lib/python2.7/dist-packages/Keras-1.0.2-py2.7.egg/keras/engine/training.pyc in _predict_loop(self, f, ins, batch_size, verbose)\r\n    837                 ins_batch = slice_X(ins, batch_ids)\r\n    838 \r\n--> 839             batch_outs = f(ins_batch)\r\n    840             if type(batch_outs) != list:\r\n    841                 batch_outs = [batch_outs]\r\n\r\n/usr/local/lib/python2.7/dist-packages/Keras-1.0.2-py2.7.egg/keras/backend/theano_backend.pyc in __call__(self, inputs)\r\n    505     def __call__(self, inputs):\r\n    506         assert type(inputs) in {list, tuple}\r\n--> 507         return self.function(*inputs)\r\n    508 \r\n    509 \r\n\r\n/usr/local/lib/python2.7/dist-packages/theano/compile/function_module.pyc in __call__(self, *args, **kwargs)\r\n    869                     node=self.fn.nodes[self.fn.position_of_error],\r\n    870                     thunk=thunk,\r\n--> 871                     storage_map=getattr(self.fn, 'storage_map', None))\r\n    872             else:\r\n    873                 # old-style linkers raise their own exceptions\r\n\r\n/usr/local/lib/python2.7/dist-packages/theano/gof/link.pyc in raise_with_op(node, thunk, exc_info, storage_map)\r\n    312         # extra long error message in that case.\r\n    313         pass\r\n--> 314     reraise(exc_type, exc_value, exc_trace)\r\n    315 \r\n    316 \r\n\r\n/usr/local/lib/python2.7/dist-packages/theano/compile/function_module.pyc in __call__(self, *args, **kwargs)\r\n    857         t0_fn = time.time()\r\n    858         try:\r\n--> 859             outputs = self.fn()\r\n    860         except Exception:\r\n    861             if hasattr(self.fn, 'position_of_error'):\r\n\r\nValueError: total size of new array must be unchanged\r\nApply node that caused the error: Reshape{3}(Elemwise{Add}[(0, 0)].0, TensorConstant{[ -1  30 512]})\r\nToposort index: 49\r\nInputs types: [TensorType(float32, matrix), TensorType(int64, vector)]\r\nInputs shapes: [(3, 512), (3,)]\r\nInputs strides: [(2048, 4), (8,)]\r\nInputs values: ['not shown', array([ -1,  30, 512])]\r\nOutputs clients: [[Join(TensorConstant{2}, Reshape{3}.0, Reshape{3}.0, Reshape{3}.0, Reshape{3}.0)]]\r\n\r\nBacktrace when the node is created(use Theano flag traceback.limit=N to make it longer):\r\n  File \"/usr/local/lib/python2.7/dist-packages/Keras-1.0.2-py2.7.egg/keras/engine/topology.py\", line 341, in create_input_layer\r\n    self(x)\r\n  File \"/usr/local/lib/python2.7/dist-packages/Keras-1.0.2-py2.7.egg/keras/engine/topology.py\", line 485, in __call__\r\n    self.add_inbound_node(inbound_layers, node_indices, tensor_indices)\r\n  File \"/usr/local/lib/python2.7/dist-packages/Keras-1.0.2-py2.7.egg/keras/engine/topology.py\", line 543, in add_inbound_node\r\n    Node.create_node(self, inbound_layers, node_indices, tensor_indices)\r\n  File \"/usr/local/lib/python2.7/dist-packages/Keras-1.0.2-py2.7.egg/keras/engine/topology.py\", line 148, in create_node\r\n    output_tensors = to_list(outbound_layer.call(input_tensors[0], mask=input_masks[0]))\r\n  File \"/usr/local/lib/python2.7/dist-packages/Keras-1.0.2-py2.7.egg/keras/layers/recurrent.py\", line 219, in call\r\n    preprocessed_input = self.preprocess_input(x)\r\n  File \"/usr/local/lib/python2.7/dist-packages/Keras-1.0.2-py2.7.egg/keras/layers/recurrent.py\", line 729, in preprocess_input\r\n    input_dim, self.output_dim, timesteps)\r\n  File \"/usr/local/lib/python2.7/dist-packages/Keras-1.0.2-py2.7.egg/keras/layers/recurrent.py\", line 38, in time_distributed_dense\r\n    x = K.reshape(x, (-1, timesteps, output_dim))\r\n  File \"/usr/local/lib/python2.7/dist-packages/Keras-1.0.2-py2.7.egg/keras/backend/theano_backend.py\", line 283, in reshape\r\n    return T.reshape(x, shape)\r\n\r\nHINT: Use the Theano flag 'exception_verbosity=high' for a debugprint and storage map footprint of this apply node.`"},"comment":{"url":"https://api.github.com/repos/iamaaditya/VQA_Demo/issues/comments/254126315","html_url":"https://github.com/iamaaditya/VQA_Demo/issues/7#issuecomment-254126315","issue_url":"https://api.github.com/repos/iamaaditya/VQA_Demo/issues/7","id":254126315,"user":{"login":"anujshah1003","id":20814689,"avatar_url":"https://avatars.githubusercontent.com/u/20814689?v=3","gravatar_id":"","url":"https://api.github.com/users/anujshah1003","html_url":"https://github.com/anujshah1003","followers_url":"https://api.github.com/users/anujshah1003/followers","following_url":"https://api.github.com/users/anujshah1003/following{/other_user}","gists_url":"https://api.github.com/users/anujshah1003/gists{/gist_id}","starred_url":"https://api.github.com/users/anujshah1003/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anujshah1003/subscriptions","organizations_url":"https://api.github.com/users/anujshah1003/orgs","repos_url":"https://api.github.com/users/anujshah1003/repos","events_url":"https://api.github.com/users/anujshah1003/events{/privacy}","received_events_url":"https://api.github.com/users/anujshah1003/received_events","type":"User","site_admin":false},"created_at":"2016-10-17T06:51:52Z","updated_at":"2016-10-17T06:51:52Z","body":"Try this two commands to get your glove vectors running\r\n\r\nsputnik --name spacy --repository-url http://index.spacy.io install en==1.1.0\r\nsputnik --name spacy en_glove_cc_300_1m_vectors"}}
{"actor":{"display_login":"anujshah1003"}}