ValueError: The hardcoded shape for thenumber of rows in the filter (5) isn't the run time shape (6)

Traceback (most recent call last):

 File"E:\tools\Anaconda\lib\site-packages\theano\compile\function_module.py",line 859, in __call__

   outputs = self.fn()

ValueError: The hardcoded shape for thenumber of rows in the filter (5) isn't the run time shape (6).

 

During handling of the above exception,another exception occurred:

 

Traceback (most recent call last):

 File "E:/Git/MachineLearning/DeepLearning Tutorials/FaceRecognition_CNN(olivettifaces)/use_cnn_new.py",line 189, in <module>

   use_CNN()

 File "E:/Git/MachineLearning/DeepLearningTutorials/FaceRecognition_CNN(olivettifaces)/use_cnn_new.py", line 180, inuse_CNN

   pred = f(faces)

 File "E:\tools\Anaconda\lib\site-packages\theano\compile\function_module.py",line 871, in __call__

   storage_map=getattr(self.fn, 'storage_map', None))

 File "E:\tools\Anaconda\lib\site-packages\theano\gof\link.py",line 314, in raise_with_op

   reraise(exc_type, exc_value, exc_trace)

 File "E:\tools\Anaconda\lib\site-packages\six.py", line 685,in reraise

   raise value.with_traceback(tb)

 File"E:\tools\Anaconda\lib\site-packages\theano\compile\function_module.py",line 859, in __call__

   outputs = self.fn()

ValueError: The hardcoded shape for the number of rows in the filter(5) isn't the run time shape (6).

Apply node that caused the error:ConvOp{('imshp', (1, 40, 50)),('kshp', (5, 5)),('nkern', 5),('bsize',1680),('dx', 1),('dy', 1),('out_mode', 'valid'),('unroll_batch',2),('unroll_kern', 5),('unroll_patch', False),('imshp_logical', (1, 40,50)),('kshp_logical', (5, 5)),('kshp_logical_top_aligned', True)}(Reshape{4}.0,<TensorType(float64, 4D)>)

Toposort index: 5

Inputs types: [TensorType(float64, (False,True, False, False)), TensorType(float64, 4D)]

Inputs shapes: [(1680, 1, 40, 50), (5, 1,6, 6)]

Inputs strides: [(16000, 16000, 400, 8),(288, 288, 48, 8)]

Inputs values: ['not shown', 'not shown']

Outputs clients: [[Pool{ds=(2, 2),ignore_border=True, st=(2, 2), padding=(0, 0), mode='max'}(ConvOp{('imshp', (1,40, 50)),('kshp', (5, 5)),('nkern', 5),('bsize', 1680),('dx', 1),('dy',1),('out_mode', 'valid'),('unroll_batch', 2),('unroll_kern',5),('unroll_patch', False),('imshp_logical', (1, 40, 50)),('kshp_logical', (5,5)),('kshp_logical_top_aligned', True)}.0)]]

 

Backtrace when the node is created(useTheano flag traceback.limit=N to make it longer):

 File "E:/Git/MachineLearning/DeepLearningTutorials/FaceRecognition_CNN(olivettifaces)/use_cnn_new.py", line 189, in<module>

   use_CNN()

 File "E:/Git/MachineLearning/DeepLearningTutorials/FaceRecognition_CNN(olivettifaces)/use_cnn_new.py", line 149, inuse_CNN

   poolsize=(2, 2)

 File "E:/Git/MachineLearning/DeepLearningTutorials/FaceRecognition_CNN(olivettifaces)/use_cnn_new.py", line 111, in__init__

   image_shape=image_shape

 

HINT: Use the Theano flag'exception_verbosity=high' for a debugprint and storage map footprint of thisapply node.

 

ValueError: The hardcoded shape for the number of rows in the filter(5) isn't the run time shape (6).来自于theano.tensor.nnet.conv

很明显的错误,就是训练时的滤波器大小和使用时的滤波器大小不一样。

眼花了,没看到训练时用的滤波器大小是6



posted on 2016-12-18 20:43  mandalalala  阅读(201)  评论(0编辑  收藏  举报