{"action":"created","issue":{"url":"https://api.github.com/repos/yanpanlau/Keras-FlappyBird/issues/3","repository_url":"https://api.github.com/repos/yanpanlau/Keras-FlappyBird","labels_url":"https://api.github.com/repos/yanpanlau/Keras-FlappyBird/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/yanpanlau/Keras-FlappyBird/issues/3/comments","events_url":"https://api.github.com/repos/yanpanlau/Keras-FlappyBird/issues/3/events","html_url":"https://github.com/yanpanlau/Keras-FlappyBird/issues/3","id":182650841,"number":3,"title":"CorrMM images and kernel must have the same stack size","user":{"login":"marionleborgne","id":2488251,"avatar_url":"https://avatars.githubusercontent.com/u/2488251?v=3","gravatar_id":"","url":"https://api.github.com/users/marionleborgne","html_url":"https://github.com/marionleborgne","followers_url":"https://api.github.com/users/marionleborgne/followers","following_url":"https://api.github.com/users/marionleborgne/following{/other_user}","gists_url":"https://api.github.com/users/marionleborgne/gists{/gist_id}","starred_url":"https://api.github.com/users/marionleborgne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marionleborgne/subscriptions","organizations_url":"https://api.github.com/users/marionleborgne/orgs","repos_url":"https://api.github.com/users/marionleborgne/repos","events_url":"https://api.github.com/users/marionleborgne/events{/privacy}","received_events_url":"https://api.github.com/users/marionleborgne/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-10-12T22:33:24Z","updated_at":"2016-10-12T22:42:57Z","closed_at":null,"body":"Hi there! Thanks for the great blog post. I ran your code with `theano` as the backend and I'm getting the stacktrace below. Any idea? It says it loaded the model but that there is an issue with the images and kernel needing to have the same stack size. \r\n\r\nAlso, are you running it with theano or tensorflow as the backend?\r\n\r\nThanks!\r\n\r\nMarion\r\n\r\n```\r\npython qlearn.py -m \"Run\"\r\nRecommended matplotlib backend is `Agg` for full skimage.viewer functionality.\r\nlibpng warning: iCCP: known incorrect sRGB profile\r\nlibpng warning: iCCP: known incorrect sRGB profile\r\nlibpng warning: iCCP: known incorrect sRGB profile\r\nlibpng warning: iCCP: known incorrect sRGB profile\r\nlibpng warning: iCCP: known incorrect sRGB profile\r\nlibpng warning: iCCP: known incorrect sRGB profile\r\nlibpng warning: iCCP: known incorrect sRGB profile\r\nlibpng warning: iCCP: known incorrect sRGB profile\r\nlibpng warning: iCCP: known incorrect sRGB profile\r\nlibpng warning: iCCP: known incorrect sRGB profile\r\nlibpng warning: iCCP: known incorrect sRGB profile\r\nlibpng warning: iCCP: known incorrect sRGB profile\r\nlibpng warning: iCCP: known incorrect sRGB profile\r\nlibpng warning: iCCP: known incorrect sRGB profile\r\nlibpng warning: iCCP: known incorrect sRGB profile\r\nUsing Theano backend.\r\nNow we build the model\r\nWe finish building the model\r\nNow we load weight\r\nWeight load successfully\r\nTraceback (most recent call last):\r\n  File \"qlearn.py\", line 198, in <module>\r\n    main()\r\n  File \"qlearn.py\", line 195, in main\r\n    playGame(args)\r\n  File \"qlearn.py\", line 189, in playGame\r\n    trainNetwork(model,args)\r\n  File \"qlearn.py\", line 107, in trainNetwork\r\n    q = model.predict(s_t)       #input a stack of 4 images, get the prediction\r\n  File \"/Users/mleborgne/Library/Python/2.7/lib/python/site-packages/keras/models.py\", line 671, in predict\r\n    return self.model.predict(x, batch_size=batch_size, verbose=verbose)\r\n  File \"/Users/mleborgne/Library/Python/2.7/lib/python/site-packages/keras/engine/training.py\", line 1179, in predict\r\n    batch_size=batch_size, verbose=verbose)\r\n  File \"/Users/mleborgne/Library/Python/2.7/lib/python/site-packages/keras/engine/training.py\", line 878, in _predict_loop\r\n    batch_outs = f(ins_batch)\r\n  File \"/Users/mleborgne/Library/Python/2.7/lib/python/site-packages/keras/backend/theano_backend.py\", line 717, in __call__\r\n    return self.function(*inputs)\r\n  File \"/Users/mleborgne/Library/Python/2.7/lib/python/site-packages/theano/compile/function_module.py\", line 871, in __call__\r\n    storage_map=getattr(self.fn, 'storage_map', None))\r\n  File \"/Users/mleborgne/Library/Python/2.7/lib/python/site-packages/theano/gof/link.py\", line 314, in raise_with_op\r\n    reraise(exc_type, exc_value, exc_trace)\r\n  File \"/Users/mleborgne/Library/Python/2.7/lib/python/site-packages/theano/compile/function_module.py\", line 859, in __call__\r\n    outputs = self.fn()\r\nValueError: CorrMM images and kernel must have the same stack size\r\n\r\nApply node that caused the error: CorrMM{half, (4, 4)}(InplaceDimShuffle{0,3,1,2}.0, Subtensor{::, ::, ::int64, ::int64}.0)\r\nToposort index: 22\r\nInputs types: [TensorType(float32, 4D), TensorType(float32, 4D)]\r\nInputs shapes: [(1, 80, 4, 80), (8, 8, 32, 4)]\r\nInputs strides: [(320, 4, 25600, 320), (4, 32, -1024, -256)]\r\nInputs values: ['not shown', 'not shown']\r\nOutputs clients: [[Subtensor{int64:int64:int8, int64:int64:int8, int64:int64:int8, int64:int64:int8}(CorrMM{half, (4, 4)}.0, ScalarFromTensor.0, ScalarFromTensor.0, Constant{1}, Constant{0}, Constant{32}, Constant{1}, ScalarFromTensor.0, ScalarFromTensor.0, Constant{1}, ScalarFromTensor.0, ScalarFromTensor.0, Constant{1})]]\r\n\r\nBacktrace when the node is created(use Theano flag traceback.limit=N to make it longer):\r\n  File \"qlearn.py\", line 44, in buildmodel\r\n    model.add(Convolution2D(32, 8, 8, subsample=(4,4),init=lambda shape, name: normal(shape, scale=0.01, name=name), border_mode='same',input_shape=(img_channels,img_rows,img_cols)))\r\n  File \"/Users/mleborgne/Library/Python/2.7/lib/python/site-packages/keras/models.py\", line 276, in add\r\n    layer.create_input_layer(batch_input_shape, input_dtype)\r\n  File \"/Users/mleborgne/Library/Python/2.7/lib/python/site-packages/keras/engine/topology.py\", line 370, in create_input_layer\r\n    self(x)\r\n  File \"/Users/mleborgne/Library/Python/2.7/lib/python/site-packages/keras/engine/topology.py\", line 514, in __call__\r\n    self.add_inbound_node(inbound_layers, node_indices, tensor_indices)\r\n  File \"/Users/mleborgne/Library/Python/2.7/lib/python/site-packages/keras/engine/topology.py\", line 572, in add_inbound_node\r\n    Node.create_node(self, inbound_layers, node_indices, tensor_indices)\r\n  File \"/Users/mleborgne/Library/Python/2.7/lib/python/site-packages/keras/engine/topology.py\", line 149, in create_node\r\n    output_tensors = to_list(outbound_layer.call(input_tensors[0], mask=input_masks[0]))\r\n  File \"/Users/mleborgne/Library/Python/2.7/lib/python/site-packages/keras/layers/convolutional.py\", line 466, in call\r\n    filter_shape=self.W_shape)\r\n  File \"/Users/mleborgne/Library/Python/2.7/lib/python/site-packages/keras/backend/theano_backend.py\", line 1135, in conv2d\r\n    filter_shape=filter_shape)\r\n```"},"comment":{"url":"https://api.github.com/repos/yanpanlau/Keras-FlappyBird/issues/comments/253360978","html_url":"https://github.com/yanpanlau/Keras-FlappyBird/issues/3#issuecomment-253360978","issue_url":"https://api.github.com/repos/yanpanlau/Keras-FlappyBird/issues/3","id":253360978,"user":{"login":"marionleborgne","id":2488251,"avatar_url":"https://avatars.githubusercontent.com/u/2488251?v=3","gravatar_id":"","url":"https://api.github.com/users/marionleborgne","html_url":"https://github.com/marionleborgne","followers_url":"https://api.github.com/users/marionleborgne/followers","following_url":"https://api.github.com/users/marionleborgne/following{/other_user}","gists_url":"https://api.github.com/users/marionleborgne/gists{/gist_id}","starred_url":"https://api.github.com/users/marionleborgne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marionleborgne/subscriptions","organizations_url":"https://api.github.com/users/marionleborgne/orgs","repos_url":"https://api.github.com/users/marionleborgne/repos","events_url":"https://api.github.com/users/marionleborgne/events{/privacy}","received_events_url":"https://api.github.com/users/marionleborgne/received_events","type":"User","site_admin":false},"created_at":"2016-10-12T22:42:57Z","updated_at":"2016-10-12T22:42:57Z","body":"Follow up: even with the backend set as `tensorflow` (CPU install) I get the same issue with the dimensions:\r\n\r\n```\r\npython qlearn.py -m \"Run\"\r\nRecommended matplotlib backend is `Agg` for full skimage.viewer functionality.\r\nlibpng warning: iCCP: known incorrect sRGB profile\r\nlibpng warning: iCCP: known incorrect sRGB profile\r\nlibpng warning: iCCP: known incorrect sRGB profile\r\nlibpng warning: iCCP: known incorrect sRGB profile\r\nlibpng warning: iCCP: known incorrect sRGB profile\r\nlibpng warning: iCCP: known incorrect sRGB profile\r\nlibpng warning: iCCP: known incorrect sRGB profile\r\nlibpng warning: iCCP: known incorrect sRGB profile\r\nlibpng warning: iCCP: known incorrect sRGB profile\r\nlibpng warning: iCCP: known incorrect sRGB profile\r\nlibpng warning: iCCP: known incorrect sRGB profile\r\nlibpng warning: iCCP: known incorrect sRGB profile\r\nlibpng warning: iCCP: known incorrect sRGB profile\r\nlibpng warning: iCCP: known incorrect sRGB profile\r\nlibpng warning: iCCP: known incorrect sRGB profile\r\nUsing TensorFlow backend.\r\nNow we build the model\r\nWe finish building the model\r\nNow we load weight\r\nTraceback (most recent call last):\r\n  File \"qlearn.py\", line 198, in <module>\r\n    main()\r\n  File \"qlearn.py\", line 195, in main\r\n    playGame(args)\r\n  File \"qlearn.py\", line 189, in playGame\r\n    trainNetwork(model,args)\r\n  File \"qlearn.py\", line 85, in trainNetwork\r\n    model.load_weights(\"model.h5\")\r\n  File \"/Users/mleborgne/Library/Python/2.7/lib/python/site-packages/keras/engine/topology.py\", line 2500, in load_weights\r\n    self.load_weights_from_hdf5_group(f)\r\n  File \"/Users/mleborgne/Library/Python/2.7/lib/python/site-packages/keras/engine/topology.py\", line 2585, in load_weights_from_hdf5_group\r\n    K.batch_set_value(weight_value_tuples)\r\n  File \"/Users/mleborgne/Library/Python/2.7/lib/python/site-packages/keras/backend/tensorflow_backend.py\", line 963, in batch_set_value\r\n    assign_op = x.assign(assign_placeholder)\r\n  File \"/Users/mleborgne/Library/Python/2.7/lib/python/site-packages/tensorflow/python/ops/variables.py\", line 505, in assign\r\n    return state_ops.assign(self._variable, value, use_locking=use_locking)\r\n  File \"/Users/mleborgne/Library/Python/2.7/lib/python/site-packages/tensorflow/python/ops/gen_state_ops.py\", line 45, in assign\r\n    use_locking=use_locking, name=name)\r\n  File \"/Users/mleborgne/Library/Python/2.7/lib/python/site-packages/tensorflow/python/framework/op_def_library.py\", line 749, in apply_op\r\n    op_def=op_def)\r\n  File \"/Users/mleborgne/Library/Python/2.7/lib/python/site-packages/tensorflow/python/framework/ops.py\", line 2382, in create_op\r\n    set_shapes_for_outputs(ret)\r\n  File \"/Users/mleborgne/Library/Python/2.7/lib/python/site-packages/tensorflow/python/framework/ops.py\", line 1783, in set_shapes_for_outputs\r\n    shapes = shape_func(op)\r\n  File \"/Users/mleborgne/Library/Python/2.7/lib/python/site-packages/tensorflow/python/framework/common_shapes.py\", line 596, in call_cpp_shape_fn\r\n    raise ValueError(err.message)\r\nValueError: Dimension 0 in both shapes must be equal, but are 8 and 32\r\n```"}}
{"actor":{"display_login":"marionleborgne"}}