When I run the program with the provided data, I met shape mismatch error. The command I used is:
root@32f2d2ff7341:~/VIN# python NN_run_training.py --model valIterBatch --input ./data/gridworld_28.mat --output ./tmp
Using gpu device 0: GeForce GTX TITAN X (CNMeM is disabled, cuDNN 5105)
/usr/local/lib/python2.7/dist-packages/theano/sandbox/cuda/__init__.py:600: UserWarning: Your cuDNN version is more recent than the one Theano officially supports. If you see any problems, try updating Theano or downgrading cuDNN to version 5.
warnings.warn(warn)
/usr/local/lib/python2.7/dist-packages/theano/tensor/signal/downsample.py:6: UserWarning: downsample module has been moved to the theano.tensor.signal.pool module.
"downsample module has been moved to the theano.tensor.signal.pool module.")
valIterBatch
Epoch | Train NLL | Train Err | Test NLL | Test Err | Epoch Time
Traceback (most recent call last):
File "NN_run_training.py", line 95, in <module>
main()
File "NN_run_training.py", line 91, in main
grad_check=args.grad_check, batch_size=args.batchsize, data_fraction=args.data_fraction)
File "/root/VIN/vin.py", line 103, in run_training
ytrain[start*self.statebatchsize:end*self.statebatchsize])
File "/usr/local/lib/python2.7/dist-packages/theano/compile/function_module.py", line 871, in __call__
storage_map=getattr(self.fn, 'storage_map', None))
File "/usr/local/lib/python2.7/dist-packages/theano/gof/link.py", line 314, in raise_with_op
reraise(exc_type, exc_value, exc_trace)
File "/usr/local/lib/python2.7/dist-packages/theano/compile/function_module.py", line 859, in __call__
outputs = self.fn()
File "/usr/local/lib/python2.7/dist-packages/theano/gof/op.py", line 912, in rval
r = p(n, [x[0] for x in i], o)
File "/usr/local/lib/python2.7/dist-packages/theano/tensor/subtensor.py", line 2166, in perform
out[0] = inputs[0].__getitem__(inputs[1:])
IndexError: shape mismatch: indexing arrays could not be broadcast together with shapes (128,) (1280,) (1280,)
Apply node that caused the error: AdvancedSubtensor(HostFromGpu.0, Reshape{1}.0, SliceConstant{None, None, None}, Reshape{1}.0, Reshape{1}.0)
Toposort index: 243
Inputs types: [TensorType(float32, 4D), TensorType(int64, vector), <theano.tensor.type_other.SliceType object at 0x7fbbf44c0a50>, TensorType(int8, vector), TensorType(int8, vector)]
Inputs shapes: [(128, 10, 28, 28), (128,), 'No shapes', (1280,), (1280,)]
Inputs strides: [(31360, 3136, 112, 4), (8,), 'No strides', (1,), (1,)]
Inputs values: ['not shown', 'not shown', slice(None, None, None), 'not shown', 'not shown']
Outputs clients: [[GpuFromHost(AdvancedSubtensor.0)]]
Backtrace when the node is created(use Theano flag traceback.limit=N to make it longer):
File "NN_run_training.py", line 95, in <module>
main()
File "NN_run_training.py", line 62, in main
batchsize=args.batchsize, statebatchsize=args.statebatchsize)
File "/root/VIN/vin.py", line 34, in __init__
k=self.k)
File "/root/VIN/vin.py", line 246, in __init__
in_s2.flatten()]
I am not good at debugging Theano (much harder than TensorFlow). I guess it was caused by the :
indexing. Could you please help on this?