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.
python qlearn.py -m "Run"
Recommended matplotlib backend is `Agg` for full skimage.viewer functionality.
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
Using Theano backend.
Now we build the model
We finish building the model
Now we load weight
Weight load successfully
Traceback (most recent call last):
File "qlearn.py", line 198, in <module>
main()
File "qlearn.py", line 195, in main
playGame(args)
File "qlearn.py", line 189, in playGame
trainNetwork(model,args)
File "qlearn.py", line 107, in trainNetwork
q = model.predict(s_t) #input a stack of 4 images, get the prediction
File "/Users/mleborgne/Library/Python/2.7/lib/python/site-packages/keras/models.py", line 671, in predict
return self.model.predict(x, batch_size=batch_size, verbose=verbose)
File "/Users/mleborgne/Library/Python/2.7/lib/python/site-packages/keras/engine/training.py", line 1179, in predict
batch_size=batch_size, verbose=verbose)
File "/Users/mleborgne/Library/Python/2.7/lib/python/site-packages/keras/engine/training.py", line 878, in _predict_loop
batch_outs = f(ins_batch)
File "/Users/mleborgne/Library/Python/2.7/lib/python/site-packages/keras/backend/theano_backend.py", line 717, in __call__
return self.function(*inputs)
File "/Users/mleborgne/Library/Python/2.7/lib/python/site-packages/theano/compile/function_module.py", line 871, in __call__
storage_map=getattr(self.fn, 'storage_map', None))
File "/Users/mleborgne/Library/Python/2.7/lib/python/site-packages/theano/gof/link.py", line 314, in raise_with_op
reraise(exc_type, exc_value, exc_trace)
File "/Users/mleborgne/Library/Python/2.7/lib/python/site-packages/theano/compile/function_module.py", line 859, in __call__
outputs = self.fn()
ValueError: CorrMM images and kernel must have the same stack size
Apply node that caused the error: CorrMM{half, (4, 4)}(InplaceDimShuffle{0,3,1,2}.0, Subtensor{::, ::, ::int64, ::int64}.0)
Toposort index: 22
Inputs types: [TensorType(float32, 4D), TensorType(float32, 4D)]
Inputs shapes: [(1, 80, 4, 80), (8, 8, 32, 4)]
Inputs strides: [(320, 4, 25600, 320), (4, 32, -1024, -256)]
Inputs values: ['not shown', 'not shown']
Outputs 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})]]
Backtrace when the node is created(use Theano flag traceback.limit=N to make it longer):
File "qlearn.py", line 44, in buildmodel
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)))
File "/Users/mleborgne/Library/Python/2.7/lib/python/site-packages/keras/models.py", line 276, in add
layer.create_input_layer(batch_input_shape, input_dtype)
File "/Users/mleborgne/Library/Python/2.7/lib/python/site-packages/keras/engine/topology.py", line 370, in create_input_layer
self(x)
File "/Users/mleborgne/Library/Python/2.7/lib/python/site-packages/keras/engine/topology.py", line 514, in __call__
self.add_inbound_node(inbound_layers, node_indices, tensor_indices)
File "/Users/mleborgne/Library/Python/2.7/lib/python/site-packages/keras/engine/topology.py", line 572, in add_inbound_node
Node.create_node(self, inbound_layers, node_indices, tensor_indices)
File "/Users/mleborgne/Library/Python/2.7/lib/python/site-packages/keras/engine/topology.py", line 149, in create_node
output_tensors = to_list(outbound_layer.call(input_tensors[0], mask=input_masks[0]))
File "/Users/mleborgne/Library/Python/2.7/lib/python/site-packages/keras/layers/convolutional.py", line 466, in call
filter_shape=self.W_shape)
File "/Users/mleborgne/Library/Python/2.7/lib/python/site-packages/keras/backend/theano_backend.py", line 1135, in conv2d
filter_shape=filter_shape)