Sorry I should have mentioned. I am using reshape to change the dimensions
to 4D:
input_left=T.dmatrix('input_left')
layer0_input_left = input_left.reshape((batch_size, n_ch, img_ht, img_wdt))
layer0_input_left then goes into the first conv layer. Its actually
throwing an error at function input itself.
I stripped the code further down: http://pastebin.com/54vHFPJJ
Hope this helps.
On Tuesday, 6 September 2016 23:18:40 UTC+5:30, Jesse Livezey wrote:
>
> Your inputs should be tensor4 rather than matrix if you're passing them
> into a CNN.
>
> On Tuesday, September 6, 2016 at 7:22:38 AM UTC-7, Ganesh Iyer wrote:
>>
>>
>> Hi guys,
>>
>> I'm new to this group and theano in general. I'm trying to send 2 image
>> patches, greyscale ( 2D numpy arrays of size (9,9) using cv2.imread(name,0)
>> ) through a CNN architecture. I'm giving these as inputs to theano.function.
>>
>> train_set_left=np.float64(train_set_left)
>> train_set_right_positive=np.float64(train_set_right_positive)
>>
>> train_model=theano.function(inputs=[input_left,input_right]
>> ,outputs=[s_plus])
>> print(train_model(train_set_left,train_set_right_positive))
>>
>> The error I get at this point is:
>>
>> at index 0(0-based)', 'Wrong number of dimensions: expected 4, got 2 with
>> shape (9, 9).')
>>
>>
>> input_left and input_right are defined earlier in the code as:
>>
>> input_left=T.dmatrix('input_left')
>> input_right=T.dmatrix('input_right')
>>
>> Is there something wrong with the input dimensions in this case?
>>
>> Full Code: http://pastebin.com/33fTyb3K
>> The code itself is based on the LeNet tutorial, but is a bit messy.
>>
>> Please Help.
>>
>
--
---
You received this message because you are subscribed to the Google Groups
"theano-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.